From 394fd57affad8b830eb259ecb6a526d76eac37da Mon Sep 17 00:00:00 2001 From: Zlib-ng Upstream Date: Wed, 13 Oct 2021 15:43:53 +0200 Subject: [PATCH] zlib-ng 2021-10-13 (a7b77369) Code extracted from: https://github.com/zlib-ng/zlib-ng.git at commit a7b773697b34c19f246defc1ffb760b0d39be391 (develop). --- .gitattributes | 2 + arch/s390/crc32-vx.c | 4 +- arch/s390/dfltcc_common.c | 2 +- arch/s390/dfltcc_common.h | 30 ++++++++++-- arch/s390/dfltcc_deflate.c | 15 +++--- arch/s390/dfltcc_deflate.h | 3 +- arch/s390/dfltcc_inflate.c | 8 ++-- arch/s390/s390.c | 2 +- arch/s390/s390.h | 2 +- compress.c | 19 +++++++- deflate_fast.c | 1 - inffast.c | 2 +- inflate.c | 4 +- win32/zlib.def | 61 ------------------------- win32/zlib.def.in | 61 +++++++++++++++++++++++++ win32/zlibcompat.def | 94 -------------------------------------- win32/zlibcompat.def.in | 94 ++++++++++++++++++++++++++++++++++++++ zlib.pc.cmakein | 1 + zutil.h | 2 + 19 files changed, 227 insertions(+), 180 deletions(-) delete mode 100644 win32/zlib.def create mode 100644 win32/zlib.def.in delete mode 100644 win32/zlibcompat.def create mode 100644 win32/zlibcompat.def.in diff --git a/.gitattributes b/.gitattributes index 68ec3a174ec..3b35744b027 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,5 @@ *.c text *.h text Makefile text +configure text eol=lf +testCVEinputs.sh text eol=lf diff --git a/arch/s390/crc32-vx.c b/arch/s390/crc32-vx.c index bb23289cd14..18b8bb22355 100644 --- a/arch/s390/crc32-vx.c +++ b/arch/s390/crc32-vx.c @@ -12,8 +12,8 @@ * relicensed under the zlib license. */ -#include "../../zutil.h" -#include "../../crc32_p.h" +#include "zutil.h" +#include "crc32_p.h" #include diff --git a/arch/s390/dfltcc_common.c b/arch/s390/dfltcc_common.c index c82c3b220c5..f1ae904ad57 100644 --- a/arch/s390/dfltcc_common.c +++ b/arch/s390/dfltcc_common.c @@ -1,6 +1,6 @@ /* dfltcc_deflate.c - IBM Z DEFLATE CONVERSION CALL general support. */ -#include "../../zbuild.h" +#include "zbuild.h" #include "dfltcc_common.h" #include "dfltcc_detail.h" diff --git a/arch/s390/dfltcc_common.h b/arch/s390/dfltcc_common.h index 5c3be91b970..6de8bb18f65 100644 --- a/arch/s390/dfltcc_common.h +++ b/arch/s390/dfltcc_common.h @@ -2,11 +2,11 @@ #define DFLTCC_COMMON_H #ifdef ZLIB_COMPAT -#include "../../zlib.h" +#include "zlib.h" #else -#include "../../zlib-ng.h" +#include "zlib-ng.h" #endif -#include "../../zutil.h" +#include "zutil.h" void Z_INTERNAL *dfltcc_alloc_state(PREFIX3(streamp) strm, uInt items, uInt size); void Z_INTERNAL dfltcc_copy_state(void *dst, const void *src, uInt size); @@ -26,4 +26,28 @@ void Z_INTERNAL dfltcc_free_window(PREFIX3(streamp) strm, void *w); #define TRY_FREE_WINDOW dfltcc_free_window +#define DFLTCC_BLOCK_HEADER_BITS 3 +#define DFLTCC_HLITS_COUNT_BITS 5 +#define DFLTCC_HDISTS_COUNT_BITS 5 +#define DFLTCC_HCLENS_COUNT_BITS 4 +#define DFLTCC_MAX_HCLENS 19 +#define DFLTCC_HCLEN_BITS 3 +#define DFLTCC_MAX_HLITS 286 +#define DFLTCC_MAX_HDISTS 30 +#define DFLTCC_MAX_HLIT_HDIST_BITS 7 +#define DFLTCC_MAX_SYMBOL_BITS 16 +#define DFLTCC_MAX_EOBS_BITS 15 +#define DFLTCC_MAX_PADDING_BITS 7 + +#define DEFLATE_BOUND_COMPLEN(source_len) \ + ((DFLTCC_BLOCK_HEADER_BITS + \ + DFLTCC_HLITS_COUNT_BITS + \ + DFLTCC_HDISTS_COUNT_BITS + \ + DFLTCC_HCLENS_COUNT_BITS + \ + DFLTCC_MAX_HCLENS * DFLTCC_HCLEN_BITS + \ + (DFLTCC_MAX_HLITS + DFLTCC_MAX_HDISTS) * DFLTCC_MAX_HLIT_HDIST_BITS + \ + (source_len) * DFLTCC_MAX_SYMBOL_BITS + \ + DFLTCC_MAX_EOBS_BITS + \ + DFLTCC_MAX_PADDING_BITS) >> 3) + #endif diff --git a/arch/s390/dfltcc_deflate.c b/arch/s390/dfltcc_deflate.c index 18786566762..0a65aa7e8e3 100644 --- a/arch/s390/dfltcc_deflate.c +++ b/arch/s390/dfltcc_deflate.c @@ -13,10 +13,10 @@ $ make */ -#include "../../zbuild.h" -#include "../../zutil.h" -#include "../../deflate.h" -#include "../../trees_emit.h" +#include "zbuild.h" +#include "zutil.h" +#include "deflate.h" +#include "trees_emit.h" #include "dfltcc_deflate.h" #include "dfltcc_detail.h" @@ -210,7 +210,7 @@ int Z_INTERNAL dfltcc_deflate(PREFIX3(streamp) strm, int flush, block_state *res *strm->next_out = (unsigned char)state->bi_buf; /* Honor history and check value */ param->nt = 0; - param->cv = state->wrap == 2 ? ZSWAP32(strm->adler) : strm->adler; + param->cv = state->wrap == 2 ? ZSWAP32(state->crc_fold.value) : strm->adler; /* When opening a block, choose a Huffman-Table Type */ if (!param->bcf) { @@ -241,7 +241,10 @@ int Z_INTERNAL dfltcc_deflate(PREFIX3(streamp) strm, int flush, block_state *res state->bi_buf = 0; /* Avoid accessing next_out */ else state->bi_buf = *strm->next_out & ((1 << state->bi_valid) - 1); - strm->adler = state->wrap == 2 ? ZSWAP32(param->cv) : param->cv; + if (state->wrap == 2) + state->crc_fold.value = ZSWAP32(param->cv); + else + strm->adler = param->cv; /* Unmask the input data */ strm->avail_in += masked_avail_in; diff --git a/arch/s390/dfltcc_deflate.h b/arch/s390/dfltcc_deflate.h index 7e32380bd89..218e5946932 100644 --- a/arch/s390/dfltcc_deflate.h +++ b/arch/s390/dfltcc_deflate.h @@ -41,8 +41,7 @@ int Z_INTERNAL dfltcc_deflate_get_dictionary(PREFIX3(streamp) strm, unsigned cha #define DEFLATE_BOUND_ADJUST_COMPLEN(strm, complen, source_len) \ do { \ if (dfltcc_can_deflate((strm))) \ - (complen) = (3 + 5 + 5 + 4 + 19 * 3 + (286 + 30) * 7 + \ - (source_len) * 16 + 15 + 7) >> 3; \ + (complen) = DEFLATE_BOUND_COMPLEN(source_len); \ } while (0) #define DEFLATE_NEED_CONSERVATIVE_BOUND(strm) (dfltcc_can_deflate((strm))) diff --git a/arch/s390/dfltcc_inflate.c b/arch/s390/dfltcc_inflate.c index f6a7e8f8650..253506466d8 100644 --- a/arch/s390/dfltcc_inflate.c +++ b/arch/s390/dfltcc_inflate.c @@ -13,10 +13,10 @@ $ make */ -#include "../../zbuild.h" -#include "../../zutil.h" -#include "../../inftrees.h" -#include "../../inflate.h" +#include "zbuild.h" +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" #include "dfltcc_inflate.h" #include "dfltcc_detail.h" diff --git a/arch/s390/s390.c b/arch/s390/s390.c index 6dd5252ce3a..a67bfc249a3 100644 --- a/arch/s390/s390.c +++ b/arch/s390/s390.c @@ -1,4 +1,4 @@ -#include "../../zutil.h" +#include "zutil.h" #include "s390.h" #include diff --git a/arch/s390/s390.h b/arch/s390/s390.h index dec035b3d91..453c58137c8 100644 --- a/arch/s390/s390.h +++ b/arch/s390/s390.h @@ -1,7 +1,7 @@ #ifndef S390_H_ #define S390_H_ -#include "../../zutil.h" +#include "zutil.h" extern int s390_cpu_has_vx; diff --git a/compress.c b/compress.c index d5379591d1c..de45e29e6a2 100644 --- a/compress.c +++ b/compress.c @@ -3,14 +3,25 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -#define ZLIB_INTERNAL #include "zbuild.h" +#include "zutil.h" #if defined(ZLIB_COMPAT) # include "zlib.h" #else # include "zlib-ng.h" #endif +/* =========================================================================== + * Architecture-specific hooks. + */ +#ifdef S390_DFLTCC_DEFLATE +# include "arch/s390/dfltcc_common.h" +#else +/* Returns the upper bound on compressed data length based on uncompressed data length, assuming default settings. + * Zero means that arch-specific deflation code behaves identically to the regular zlib-ng algorithms. */ +# define DEFLATE_BOUND_COMPLEN(source_len) 0 +#endif + /* =========================================================================== Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte @@ -73,6 +84,12 @@ int Z_EXPORT PREFIX(compress)(unsigned char *dest, z_size_t *destLen, const unsi this function needs to be updated. */ z_size_t Z_EXPORT PREFIX(compressBound)(z_size_t sourceLen) { + z_size_t complen = DEFLATE_BOUND_COMPLEN(sourceLen); + + if (complen > 0) + /* Architecture-specific code provided an upper bound. */ + return complen + ZLIB_WRAPLEN; + #ifndef NO_QUICK_STRATEGY /* Quick deflate strategy worse case is 9 bits per literal, rounded to nearest byte, plus the size of block & gzip headers and footers */ diff --git a/deflate_fast.c b/deflate_fast.c index 4142a7aa4c4..c6e24e48a2a 100644 --- a/deflate_fast.c +++ b/deflate_fast.c @@ -47,7 +47,6 @@ Z_INTERNAL block_state deflate_fast(deflate_state *s, int flush) { /* Find the longest match, discarding those <= prev_length. * At this point we have always match length < WANT_MIN_MATCH */ - if (dist <= MAX_DIST(s) && dist > 0 && hash_head != 0) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match diff --git a/inffast.c b/inffast.c index de71271b2cb..2c3add3a84d 100644 --- a/inffast.c +++ b/inffast.c @@ -155,7 +155,7 @@ void Z_INTERNAL zng_inflate_fast(PREFIX3(stream) *strm, unsigned long start) { /* Detect if out and window point to the same memory allocation. In this instance it is necessary to use safe chunk copy functions to prevent overwriting the window. If the window is overwritten then future matches with far distances will fail to copy correctly. */ - extra_safe = (out >= window && out + INFLATE_FAST_MIN_LEFT <= window + wsize); + extra_safe = (wsize != 0 && out >= window && out + INFLATE_FAST_MIN_LEFT <= window + wsize); /* decode literals and length/distances until end-of-block or not enough input data or output space */ diff --git a/inflate.c b/inflate.c index 45c90232ad0..f87d6c94d5f 100644 --- a/inflate.c +++ b/inflate.c @@ -1206,8 +1206,8 @@ int32_t Z_EXPORT PREFIX(inflateSync)(PREFIX3(stream) *strm) { in = strm->total_in; out = strm->total_out; PREFIX(inflateReset)(strm); - strm->total_in = in; - strm->total_out = out; + strm->total_in = (z_size_t)in; + strm->total_out = (z_size_t)out; state->flags = flags; state->mode = TYPE; return Z_OK; diff --git a/win32/zlib.def b/win32/zlib.def deleted file mode 100644 index 67644205a76..00000000000 --- a/win32/zlib.def +++ /dev/null @@ -1,61 +0,0 @@ -; zlib data compression library -EXPORTS -; basic functions - zlibVersion - deflate - deflateEnd - inflate - inflateEnd -; advanced functions - deflateSetDictionary - deflateGetDictionary - deflateCopy - deflateReset - deflateParams - deflateTune - deflateBound - deflatePending - deflatePrime - deflateSetHeader - inflateSetDictionary - inflateGetDictionary - inflateSync - inflateCopy - inflateReset - inflateReset2 - inflatePrime - inflateMark - inflateGetHeader - inflateBack - inflateBackEnd - zlibCompileFlags -; utility functions - compress - compress2 - compressBound - uncompress - uncompress2 -; large file functions - adler32_combine64 - crc32_combine64 -; checksum functions - adler32 - adler32_z - crc32 - crc32_z - adler32_combine - crc32_combine -; various hacks, don't look :) - deflateInit_ - deflateInit2_ - inflateInit_ - inflateInit2_ - inflateBackInit_ - zError - inflateSyncPoint - get_crc_table - inflateUndermine - inflateValidate - inflateCodesUsed - inflateResetKeep - deflateResetKeep diff --git a/win32/zlib.def.in b/win32/zlib.def.in new file mode 100644 index 00000000000..66a6f66fb44 --- /dev/null +++ b/win32/zlib.def.in @@ -0,0 +1,61 @@ +; zlib data compression library +EXPORTS +; basic functions + @ZLIB_SYMBOL_PREFIX@zlibVersion + @ZLIB_SYMBOL_PREFIX@deflate + @ZLIB_SYMBOL_PREFIX@deflateEnd + @ZLIB_SYMBOL_PREFIX@inflate + @ZLIB_SYMBOL_PREFIX@inflateEnd +; advanced functions + @ZLIB_SYMBOL_PREFIX@deflateSetDictionary + @ZLIB_SYMBOL_PREFIX@deflateGetDictionary + @ZLIB_SYMBOL_PREFIX@deflateCopy + @ZLIB_SYMBOL_PREFIX@deflateReset + @ZLIB_SYMBOL_PREFIX@deflateParams + @ZLIB_SYMBOL_PREFIX@deflateTune + @ZLIB_SYMBOL_PREFIX@deflateBound + @ZLIB_SYMBOL_PREFIX@deflatePending + @ZLIB_SYMBOL_PREFIX@deflatePrime + @ZLIB_SYMBOL_PREFIX@deflateSetHeader + @ZLIB_SYMBOL_PREFIX@inflateSetDictionary + @ZLIB_SYMBOL_PREFIX@inflateGetDictionary + @ZLIB_SYMBOL_PREFIX@inflateSync + @ZLIB_SYMBOL_PREFIX@inflateCopy + @ZLIB_SYMBOL_PREFIX@inflateReset + @ZLIB_SYMBOL_PREFIX@inflateReset2 + @ZLIB_SYMBOL_PREFIX@inflatePrime + @ZLIB_SYMBOL_PREFIX@inflateMark + @ZLIB_SYMBOL_PREFIX@inflateGetHeader + @ZLIB_SYMBOL_PREFIX@inflateBack + @ZLIB_SYMBOL_PREFIX@inflateBackEnd + @ZLIB_SYMBOL_PREFIX@zlibCompileFlags +; utility functions + @ZLIB_SYMBOL_PREFIX@compress + @ZLIB_SYMBOL_PREFIX@compress2 + @ZLIB_SYMBOL_PREFIX@compressBound + @ZLIB_SYMBOL_PREFIX@uncompress + @ZLIB_SYMBOL_PREFIX@uncompress2 +; large file functions + @ZLIB_SYMBOL_PREFIX@adler32_combine64 + @ZLIB_SYMBOL_PREFIX@crc32_combine64 +; checksum functions + @ZLIB_SYMBOL_PREFIX@adler32 + @ZLIB_SYMBOL_PREFIX@adler32_z + @ZLIB_SYMBOL_PREFIX@crc32 + @ZLIB_SYMBOL_PREFIX@crc32_z + @ZLIB_SYMBOL_PREFIX@adler32_combine + @ZLIB_SYMBOL_PREFIX@crc32_combine +; various hacks, don't look :) + @ZLIB_SYMBOL_PREFIX@deflateInit_ + @ZLIB_SYMBOL_PREFIX@deflateInit2_ + @ZLIB_SYMBOL_PREFIX@inflateInit_ + @ZLIB_SYMBOL_PREFIX@inflateInit2_ + @ZLIB_SYMBOL_PREFIX@inflateBackInit_ + @ZLIB_SYMBOL_PREFIX@zError + @ZLIB_SYMBOL_PREFIX@inflateSyncPoint + @ZLIB_SYMBOL_PREFIX@get_crc_table + @ZLIB_SYMBOL_PREFIX@inflateUndermine + @ZLIB_SYMBOL_PREFIX@inflateValidate + @ZLIB_SYMBOL_PREFIX@inflateCodesUsed + @ZLIB_SYMBOL_PREFIX@inflateResetKeep + @ZLIB_SYMBOL_PREFIX@deflateResetKeep diff --git a/win32/zlibcompat.def b/win32/zlibcompat.def deleted file mode 100644 index a2188b00062..00000000000 --- a/win32/zlibcompat.def +++ /dev/null @@ -1,94 +0,0 @@ -; zlib data compression library -EXPORTS -; basic functions - zlibVersion - deflate - deflateEnd - inflate - inflateEnd -; advanced functions - deflateSetDictionary - deflateGetDictionary - deflateCopy - deflateReset - deflateParams - deflateTune - deflateBound - deflatePending - deflatePrime - deflateSetHeader - inflateSetDictionary - inflateGetDictionary - inflateSync - inflateCopy - inflateReset - inflateReset2 - inflatePrime - inflateMark - inflateGetHeader - inflateBack - inflateBackEnd - zlibCompileFlags -; utility functions - compress - compress2 - compressBound - uncompress - uncompress2 - gzopen - gzdopen - gzbuffer - gzsetparams - gzread - gzfread - gzwrite - gzfwrite - gzprintf - gzvprintf - gzputs - gzgets - gzputc - gzgetc - gzungetc - gzflush - gzseek - gzrewind - gztell - gzoffset - gzeof - gzdirect - gzclose - gzclose_r - gzclose_w - gzerror - gzclearerr -; large file functions - gzopen64 - gzseek64 - gztell64 - gzoffset64 - adler32_combine64 - crc32_combine64 -; checksum functions - adler32 - adler32_z - crc32 - crc32_z - adler32_combine - crc32_combine -; various hacks, don't look :) - deflateInit_ - deflateInit2_ - inflateInit_ - inflateInit2_ - inflateBackInit_ - gzgetc_ - zError - inflateSyncPoint - get_crc_table - inflateUndermine - inflateValidate - inflateCodesUsed - inflateResetKeep - deflateResetKeep - gzopen_w diff --git a/win32/zlibcompat.def.in b/win32/zlibcompat.def.in new file mode 100644 index 00000000000..dbb3c3f7122 --- /dev/null +++ b/win32/zlibcompat.def.in @@ -0,0 +1,94 @@ +; zlib data compression library +EXPORTS +; basic functions + @ZLIB_SYMBOL_PREFIX@zlibVersion + @ZLIB_SYMBOL_PREFIX@deflate + @ZLIB_SYMBOL_PREFIX@deflateEnd + @ZLIB_SYMBOL_PREFIX@inflate + @ZLIB_SYMBOL_PREFIX@inflateEnd +; advanced functions + @ZLIB_SYMBOL_PREFIX@deflateSetDictionary + @ZLIB_SYMBOL_PREFIX@deflateGetDictionary + @ZLIB_SYMBOL_PREFIX@deflateCopy + @ZLIB_SYMBOL_PREFIX@deflateReset + @ZLIB_SYMBOL_PREFIX@deflateParams + @ZLIB_SYMBOL_PREFIX@deflateTune + @ZLIB_SYMBOL_PREFIX@deflateBound + @ZLIB_SYMBOL_PREFIX@deflatePending + @ZLIB_SYMBOL_PREFIX@deflatePrime + @ZLIB_SYMBOL_PREFIX@deflateSetHeader + @ZLIB_SYMBOL_PREFIX@inflateSetDictionary + @ZLIB_SYMBOL_PREFIX@inflateGetDictionary + @ZLIB_SYMBOL_PREFIX@inflateSync + @ZLIB_SYMBOL_PREFIX@inflateCopy + @ZLIB_SYMBOL_PREFIX@inflateReset + @ZLIB_SYMBOL_PREFIX@inflateReset2 + @ZLIB_SYMBOL_PREFIX@inflatePrime + @ZLIB_SYMBOL_PREFIX@inflateMark + @ZLIB_SYMBOL_PREFIX@inflateGetHeader + @ZLIB_SYMBOL_PREFIX@inflateBack + @ZLIB_SYMBOL_PREFIX@inflateBackEnd + @ZLIB_SYMBOL_PREFIX@zlibCompileFlags +; utility functions + @ZLIB_SYMBOL_PREFIX@compress + @ZLIB_SYMBOL_PREFIX@compress2 + @ZLIB_SYMBOL_PREFIX@compressBound + @ZLIB_SYMBOL_PREFIX@uncompress + @ZLIB_SYMBOL_PREFIX@uncompress2 + @ZLIB_SYMBOL_PREFIX@gzopen + @ZLIB_SYMBOL_PREFIX@gzdopen + @ZLIB_SYMBOL_PREFIX@gzbuffer + @ZLIB_SYMBOL_PREFIX@gzsetparams + @ZLIB_SYMBOL_PREFIX@gzread + @ZLIB_SYMBOL_PREFIX@gzfread + @ZLIB_SYMBOL_PREFIX@gzwrite + @ZLIB_SYMBOL_PREFIX@gzfwrite + @ZLIB_SYMBOL_PREFIX@gzprintf + @ZLIB_SYMBOL_PREFIX@gzvprintf + @ZLIB_SYMBOL_PREFIX@gzputs + @ZLIB_SYMBOL_PREFIX@gzgets + @ZLIB_SYMBOL_PREFIX@gzputc + @ZLIB_SYMBOL_PREFIX@gzgetc + @ZLIB_SYMBOL_PREFIX@gzungetc + @ZLIB_SYMBOL_PREFIX@gzflush + @ZLIB_SYMBOL_PREFIX@gzseek + @ZLIB_SYMBOL_PREFIX@gzrewind + @ZLIB_SYMBOL_PREFIX@gztell + @ZLIB_SYMBOL_PREFIX@gzoffset + @ZLIB_SYMBOL_PREFIX@gzeof + @ZLIB_SYMBOL_PREFIX@gzdirect + @ZLIB_SYMBOL_PREFIX@gzclose + @ZLIB_SYMBOL_PREFIX@gzclose_r + @ZLIB_SYMBOL_PREFIX@gzclose_w + @ZLIB_SYMBOL_PREFIX@gzerror + @ZLIB_SYMBOL_PREFIX@gzclearerr +; large file functions + @ZLIB_SYMBOL_PREFIX@gzopen64 + @ZLIB_SYMBOL_PREFIX@gzseek64 + @ZLIB_SYMBOL_PREFIX@gztell64 + @ZLIB_SYMBOL_PREFIX@gzoffset64 + @ZLIB_SYMBOL_PREFIX@adler32_combine64 + @ZLIB_SYMBOL_PREFIX@crc32_combine64 +; checksum functions + @ZLIB_SYMBOL_PREFIX@adler32 + @ZLIB_SYMBOL_PREFIX@adler32_z + @ZLIB_SYMBOL_PREFIX@crc32 + @ZLIB_SYMBOL_PREFIX@crc32_z + @ZLIB_SYMBOL_PREFIX@adler32_combine + @ZLIB_SYMBOL_PREFIX@crc32_combine +; various hacks, don't look :) + @ZLIB_SYMBOL_PREFIX@deflateInit_ + @ZLIB_SYMBOL_PREFIX@deflateInit2_ + @ZLIB_SYMBOL_PREFIX@inflateInit_ + @ZLIB_SYMBOL_PREFIX@inflateInit2_ + @ZLIB_SYMBOL_PREFIX@inflateBackInit_ + @ZLIB_SYMBOL_PREFIX@gzgetc_ + @ZLIB_SYMBOL_PREFIX@zError + @ZLIB_SYMBOL_PREFIX@inflateSyncPoint + @ZLIB_SYMBOL_PREFIX@get_crc_table + @ZLIB_SYMBOL_PREFIX@inflateUndermine + @ZLIB_SYMBOL_PREFIX@inflateValidate + @ZLIB_SYMBOL_PREFIX@inflateCodesUsed + @ZLIB_SYMBOL_PREFIX@inflateResetKeep + @ZLIB_SYMBOL_PREFIX@deflateResetKeep + @ZLIB_SYMBOL_PREFIX@gzopen_w diff --git a/zlib.pc.cmakein b/zlib.pc.cmakein index 9b64252dc2a..3d440ce6bdc 100644 --- a/zlib.pc.cmakein +++ b/zlib.pc.cmakein @@ -1,5 +1,6 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} +symbol_prefix=@ZLIB_SYMBOL_PREFIX@ libdir=@PC_LIB_INSTALL_DIR@ sharedlibdir=${libdir} includedir=@PC_INC_INSTALL_DIR@ diff --git a/zutil.h b/zutil.h index 0a44f775c37..e7cb9ad3e47 100644 --- a/zutil.h +++ b/zutil.h @@ -78,6 +78,8 @@ extern z_const char * const PREFIX(z_errmsg)[10]; /* indexed by 2-zlib_error */ #define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */ #define CRC32_INITIAL_VALUE 0 /* initial crc-32 hash value */ +#define ZLIB_WRAPLEN 6 /* zlib format overhead */ + /* target dependencies */ #ifdef AMIGA