From: Yann Collet Date: Sat, 18 Nov 2017 19:16:39 +0000 (-0800) Subject: fix ZSTD_COMPRESSBOUND() macro X-Git-Tag: v1.3.3^2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d11661c3ecd0cd121ca10543bf0d7200b9b3821b;p=thirdparty%2Fzstd.git fix ZSTD_COMPRESSBOUND() macro It was using macro `KB`, which is not defined in `zstd.h`. --- diff --git a/lib/zstd.h b/lib/zstd.h index f07c9eed2..919d1e2e0 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -131,7 +131,7 @@ ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t /*====== Helper functions ======*/ -#define ZSTD_COMPRESSBOUND(srcSize) ((srcSize) + ((srcSize)>>8) + (((srcSize) < 128 KB) ? ((128 KB - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0)) /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */ +#define ZSTD_COMPRESSBOUND(srcSize) ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0)) /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */ ZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case scenario */ ZSTDLIB_API unsigned ZSTD_isError(size_t code); /*!< tells if a `size_t` function result is an error code */ ZSTDLIB_API const char* ZSTD_getErrorName(size_t code); /*!< provides readable string from an error code */