From db188990fc306a232ad985721b761071bf418ad5 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Tue, 4 Feb 2014 14:52:57 -0800 Subject: [PATCH] ftello64 -> ftell and fopen64 -> fopen (to make Mac OSX happy) disable some warning (no idea why weak_link is there) --- btgui/minizip/ioapi.c | 19 +++++++++++++++---- src/clew/clew.h | 3 ++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/btgui/minizip/ioapi.c b/btgui/minizip/ioapi.c index 49958f61f..cdf203208 100644 --- a/btgui/minizip/ioapi.c +++ b/btgui/minizip/ioapi.c @@ -98,6 +98,7 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in return file; } + static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) { FILE* file = NULL; @@ -112,11 +113,15 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, mode_fopen = "wb"; if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen64((const char*)filename, mode_fopen); - return file; + // file = fopen64((const char*)filename, mode_fopen); + file = fopen((const char*)filename, mode_fopen); + + + return file; } + static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) { uLong ret; @@ -142,7 +147,9 @@ 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 = ftello64((FILE *)stream); + ret = ftell((FILE *)stream); + + // ret = ftello64((FILE *)stream); return ret; } @@ -188,7 +195,9 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T } ret = 0; - if(fseeko64((FILE *)stream, offset, fseek_origin) != 0) + if(fseek((FILE *)stream, offset, fseek_origin) != 0) + +// if(fseeko64((FILE *)stream, offset, fseek_origin) != 0) ret = -1; return ret; @@ -222,6 +231,7 @@ void fill_fopen_filefunc (pzlib_filefunc_def) pzlib_filefunc_def->opaque = NULL; } + void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen64_file = fopen64_file_func; @@ -233,3 +243,4 @@ void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) pzlib_filefunc_def->zerror_file = ferror_file_func; pzlib_filefunc_def->opaque = NULL; } + diff --git a/src/clew/clew.h b/src/clew/clew.h index 063eeb337..ee0fef18b 100644 --- a/src/clew/clew.h +++ b/src/clew/clew.h @@ -72,8 +72,9 @@ extern "C" { #define CL_API_CALL #define CL_CALLBACK #endif +//disabled the APPLE thing, don't know why it is there, is just causes tons of warnings -#ifdef __APPLE__ +#ifdef __APPLE1__ #define CL_EXTENSION_WEAK_LINK __attribute__((weak_import)) #define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER #define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER