From: Przemyslaw Skibinski Date: Mon, 28 Nov 2016 11:46:16 +0000 (+0100) Subject: Z_TREES only with ZLIB_VERNUM >= 0x1240 X-Git-Tag: v1.1.2~55^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edd3e2a83435b5e72a51d302aec95cf79d49e590;p=thirdparty%2Fzstd.git Z_TREES only with ZLIB_VERNUM >= 0x1240 --- diff --git a/zlibWrapper/README.md b/zlibWrapper/README.md index 5fefac1d3..cbf1b1b30 100644 --- a/zlibWrapper/README.md +++ b/zlibWrapper/README.md @@ -137,12 +137,12 @@ Supported methods: - compress2 - compressBound - uncompress +- gzip file access functions Ignored methods (they do nothing): - deflateParams Unsupported methods: -- gzip file access functions - deflateCopy - deflateTune - deflatePending diff --git a/zlibWrapper/zstd_zlibwrapper.c b/zlibWrapper/zstd_zlibwrapper.c index 477c53b41..3b23358f3 100644 --- a/zlibWrapper/zstd_zlibwrapper.c +++ b/zlibWrapper/zstd_zlibwrapper.c @@ -321,7 +321,12 @@ ZEXTERN int ZEXPORT z_deflate OF((z_streamp strm, int flush)) strm->avail_in -= zwc->inBuffer.pos; } - if (flush == Z_FULL_FLUSH || flush == Z_BLOCK || flush == Z_TREES) return ZWRAPC_finishWithErrorMsg(strm, "Z_FULL_FLUSH, Z_BLOCK and Z_TREES are not supported!"); + if (flush == Z_FULL_FLUSH +#if ZLIB_VERNUM >= 0x1240 + || flush == Z_TREES +#endif + || flush == Z_BLOCK) + return ZWRAPC_finishWithErrorMsg(strm, "Z_FULL_FLUSH, Z_BLOCK and Z_TREES are not supported!"); if (flush == Z_FINISH) { size_t bytesLeft;