From edd3e2a83435b5e72a51d302aec95cf79d49e590 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Mon, 28 Nov 2016 12:46:16 +0100 Subject: [PATCH] Z_TREES only with ZLIB_VERNUM >= 0x1240 --- zlibWrapper/README.md | 2 +- zlibWrapper/zstd_zlibwrapper.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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;