fix Mac OSX build (and remove 'weak link' warning)
This commit is contained in:
@@ -98,23 +98,6 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in
|
|||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
|
|
||||||
{
|
|
||||||
FILE* file = NULL;
|
|
||||||
const char* mode_fopen = NULL;
|
|
||||||
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
|
|
||||||
mode_fopen = "rb";
|
|
||||||
else
|
|
||||||
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
|
|
||||||
mode_fopen = "r+b";
|
|
||||||
else
|
|
||||||
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
|
|
||||||
mode_fopen = "wb";
|
|
||||||
|
|
||||||
if ((filename!=NULL) && (mode_fopen != NULL))
|
|
||||||
file = fopen64((const char*)filename, mode_fopen);
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
|
static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
|
||||||
@@ -222,14 +205,3 @@ void fill_fopen_filefunc (pzlib_filefunc_def)
|
|||||||
pzlib_filefunc_def->opaque = NULL;
|
pzlib_filefunc_def->opaque = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def)
|
|
||||||
{
|
|
||||||
pzlib_filefunc_def->zopen64_file = fopen64_file_func;
|
|
||||||
pzlib_filefunc_def->zread_file = fread_file_func;
|
|
||||||
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
|
|
||||||
pzlib_filefunc_def->ztell64_file = ftell64_file_func;
|
|
||||||
pzlib_filefunc_def->zseek64_file = fseek64_file_func;
|
|
||||||
pzlib_filefunc_def->zclose_file = fclose_file_func;
|
|
||||||
pzlib_filefunc_def->zerror_file = ferror_file_func;
|
|
||||||
pzlib_filefunc_def->opaque = NULL;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -605,9 +605,9 @@ local unzFile unzOpenInternal (const void *path,
|
|||||||
|
|
||||||
us.z_filefunc.zseek32_file = NULL;
|
us.z_filefunc.zseek32_file = NULL;
|
||||||
us.z_filefunc.ztell32_file = NULL;
|
us.z_filefunc.ztell32_file = NULL;
|
||||||
if (pzlib_filefunc64_32_def==NULL)
|
// if (pzlib_filefunc64_32_def==NULL)
|
||||||
fill_fopen64_filefunc(&us.z_filefunc.zfile_func64);
|
// fill_fopen64_filefunc(&us.z_filefunc.zfile_func64);
|
||||||
else
|
//else
|
||||||
us.z_filefunc = *pzlib_filefunc64_32_def;
|
us.z_filefunc = *pzlib_filefunc64_32_def;
|
||||||
us.is64bitOpenFunction = is64bitOpenFunction;
|
us.is64bitOpenFunction = is64bitOpenFunction;
|
||||||
|
|
||||||
|
|||||||
@@ -854,9 +854,9 @@ extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* gl
|
|||||||
|
|
||||||
ziinit.z_filefunc.zseek32_file = NULL;
|
ziinit.z_filefunc.zseek32_file = NULL;
|
||||||
ziinit.z_filefunc.ztell32_file = NULL;
|
ziinit.z_filefunc.ztell32_file = NULL;
|
||||||
if (pzlib_filefunc64_32_def==NULL)
|
// if (pzlib_filefunc64_32_def==NULL)
|
||||||
fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64);
|
// fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64);
|
||||||
else
|
// else
|
||||||
ziinit.z_filefunc = *pzlib_filefunc64_32_def;
|
ziinit.z_filefunc = *pzlib_filefunc64_32_def;
|
||||||
|
|
||||||
ziinit.filestream = ZOPEN64(ziinit.z_filefunc,
|
ziinit.filestream = ZOPEN64(ziinit.z_filefunc,
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ extern "C" {
|
|||||||
#define CL_CALLBACK
|
#define CL_CALLBACK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE1__
|
||||||
#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
|
#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_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
|
#define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
|
||||||
|
|||||||
Reference in New Issue
Block a user