summaryrefslogtreecommitdiff
path: root/zlib.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-06-10 11:18:17 -0700
committerJunio C Hamano <gitster@pobox.com>2011-06-10 11:18:17 -0700
commit225a6f1068f71723a910e8565db4e252b3ca21fa (patch)
tree5c7e5981d71f9ef025d1acb11b3e6350da3278b7 /zlib.c
parent55bb5c9147a209eba44c3e9866704ece424c3d31 (diff)
downloadgit-225a6f1068f71723a910e8565db4e252b3ca21fa.tar.gz
zlib: wrap deflateBound() too
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'zlib.c')
-rw-r--r--zlib.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/zlib.c b/zlib.c
index ee47a3a4a9..8f19d2fe38 100644
--- a/zlib.c
+++ b/zlib.c
@@ -78,6 +78,15 @@ int git_inflate(z_streamp 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(z_streamp strm, unsigned long size)
+{
+ return deflateBound(strm, size);
+}
+
void git_deflate_init(z_streamp strm, int level)
{
int status = deflateInit(strm, level);