diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-02-16 15:14:29 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-16 15:14:30 -0800 |
commit | 00e38ba6d801143a10f762d781e3e885243caa42 (patch) | |
tree | 0f423fcfd8edda84aca0f7a79da19295346bd15d /git-compat-util.h | |
parent | f2cb46a6b3398308d148c037fdd786e6d45b59bf (diff) | |
parent | 07564773c2569d012719ab9e26b9b27251f3d354 (diff) | |
download | git-00e38ba6d801143a10f762d781e3e885243caa42.tar.gz |
Merge branch 'ab/auto-detect-zlib-compress2'
The build procedure has been taught to notice older version of zlib
and enable our replacement uncompress2() automatically.
* ab/auto-detect-zlib-compress2:
compat: auto-detect if zlib has uncompress2()
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 350b122221..876907b9df 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1398,6 +1398,18 @@ void unleak_memory(const void *ptr, size_t len); #define UNLEAK(var) do {} while (0) #endif +#define z_const +#include <zlib.h> + +#if ZLIB_VERNUM < 0x1290 +/* + * This is uncompress2, which is only available in zlib >= 1.2.9 + * (released as of early 2017). See compat/zlib-uncompress2.c. + */ +int uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong *sourceLen); +#endif + /* * This include must come after system headers, since it introduces macros that * replace system names. |