aboutsummaryrefslogtreecommitdiffstats
path: root/git-zlib.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-01-28 09:41:31 +0100
committerJunio C Hamano <gitster@pobox.com>2025-01-28 13:03:22 -0800
commita2dcb6999837c762b85735174eb16f941830a2e7 (patch)
treef7546772f1addffbb4810e6fb0a2d3b832d41155 /git-zlib.c
parentgit-compat-util: move include of "compat/zlib.h" into "git-zlib.h" (diff)
downloadgit-a2dcb6999837c762b85735174eb16f941830a2e7.tar.gz
git-a2dcb6999837c762b85735174eb16f941830a2e7.zip
compat/zlib: provide `deflateBound()` shim centrally
The `deflateBound()` function has only been introduced with zlib 1.2.0. When linking against a zlib version older than that we thus provide our own compatibility shim. Move this shim into "compat/zlib.h" so that we can adapt it based on whether or not we use zlib-ng in a subsequent commit. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-zlib.c')
-rw-r--r--git-zlib.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/git-zlib.c b/git-zlib.c
index d43bbeb6da..2e973320c2 100644
--- a/git-zlib.c
+++ b/git-zlib.c
@@ -147,10 +147,6 @@ int git_inflate(git_zstream *strm, int flush)
return status;
}
-#if defined(NO_DEFLATE_BOUND) || ZLIB_VERNUM < 0x1200
-#define deflateBound(c,s) ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
-#endif
-
unsigned long git_deflate_bound(git_zstream *strm, unsigned long size)
{
return deflateBound(&strm->z, size);