From c77befef811040c126adf37b8e421e99f9a1a822 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Mon, 28 Nov 2016 14:09:26 +0100 Subject: [PATCH] make gz* functions compatible with zlib 1.2.3+ --- zlibWrapper/gzcompatibility.h | 4 +--- zlibWrapper/gzread.c | 13 +++++++++++++ zlibWrapper/zstd_zlibwrapper.h | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/zlibWrapper/gzcompatibility.h b/zlibWrapper/gzcompatibility.h index d6e83a737..a4f275e11 100644 --- a/zlibWrapper/gzcompatibility.h +++ b/zlibWrapper/gzcompatibility.h @@ -7,9 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#if ZLIB_VERNUM == 0x1260 && !defined(_LARGEFILE64_SOURCE) - // #define _LARGEFILE64_SOURCE 0 -#endif + #if ZLIB_VERNUM <= 0x1240 ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); diff --git a/zlibWrapper/gzread.c b/zlibWrapper/gzread.c index 2d28122d8..c982b1429 100644 --- a/zlibWrapper/gzread.c +++ b/zlibWrapper/gzread.c @@ -381,11 +381,24 @@ int ZEXPORT gzread(file, buf, len) } /* -- see zlib.h -- */ +#if ZLIB_VERNUM >= 0x1261 #ifdef Z_PREFIX_SET # undef z_gzgetc #else # undef gzgetc #endif +#endif + +#if ZLIB_VERNUM == 0x1260 +# undef gzgetc +#endif + +#if ZLIB_VERNUM <= 0x1250 +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); +#endif + + int ZEXPORT gzgetc(file) gzFile file; { diff --git a/zlibWrapper/zstd_zlibwrapper.h b/zlibWrapper/zstd_zlibwrapper.h index 45d15bac0..382716921 100644 --- a/zlibWrapper/zstd_zlibwrapper.h +++ b/zlibWrapper/zstd_zlibwrapper.h @@ -17,6 +17,7 @@ extern "C" { #define ZLIB_CONST #define Z_PREFIX +#define ZLIB_INTERNAL /* disables gz*64 functions but fixes zlib 1.2.4 with Z_PREFIX */ #include #if !defined(z_const)