From: R.J.V. Bertin Date: Tue, 23 May 2017 17:46:55 +0000 (+0200) Subject: ZLIB_COMPAT: add an extra 32 bits of padding in z_stream X-Git-Tag: 1.9.9-b1~660^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71b6bbe4fd7149cde19f80cc684354c88c92f233;p=thirdparty%2Fzlib-ng.git ZLIB_COMPAT: add an extra 32 bits of padding in z_stream zlib "stock" uses an "uLong" for zstream::adler, meaning 4 bytes in 64 bit bits. The padding makes zlib-ng a drop-in replacement for libz; without, the deflateInit2_() function returns a version error when called from dependents that were built against "stock" zlib. Committed from host : Portia.local --- diff --git a/zlib.h b/zlib.h index 05b28c2f6..f7b460a6d 100644 --- a/zlib.h +++ b/zlib.h @@ -109,6 +109,9 @@ typedef struct z_stream_s { int data_type; /* best guess about the data type: binary or text for deflate, or the decoding state for inflate */ uint32_t adler; /* Adler-32 or CRC-32 value of the uncompressed data */ +#if defined(ZLIB_COMPAT) && defined(X86_64) + uint32_t padding; /* pad out to the same size as the zlib struct */ +#endif unsigned long reserved; /* reserved for future use */ } z_stream;