Skip to content

Commit

Permalink
fix file api macro (#343)
Browse files Browse the repository at this point in the history
* remove USE_FILE32API macro

* add defination

* update
  • Loading branch information
PatriceJiang authored and drelaptop committed Jan 10, 2019
1 parent 4ded6d5 commit 6b57fb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unzip/ioapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
{
ZPOS64_T ret;
ret = ftello((FILE *)stream);
ret = ftell((FILE *)stream);
return ret;
}

Expand Down Expand Up @@ -186,7 +186,7 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
break;
default: return -1;
}
if(fseeko((FILE *)stream, offset, fseek_origin) != 0)
if(fseek((FILE *)stream, offset, fseek_origin) != 0)
return -1;
return 0;
}
Expand Down
4 changes: 4 additions & 0 deletions unzip/ioapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ namespace cocos2d {
#define fopen64 fopen
#define ftello64 ftell
#define fseeko64 fseek
#define ftello ftell
#define fseeko fseek
#else
#ifdef _MSC_VER
#define fopen64 fopen
#if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
#define ftello64 _ftelli64
#define fseeko64 _fseeki64
#define ftello _ftelli64
#define fseeko _fseeki64
#else // old MSC
#define ftello64 ftell
#define fseeko64 fseek
Expand Down

0 comments on commit 6b57fb1

Please sign in to comment.