summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-02-16 23:14:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-16 23:14:30 (GMT)
commit00e38ba6d801143a10f762d781e3e885243caa42 (patch)
tree0f423fcfd8edda84aca0f7a79da19295346bd15d /compat
parentf2cb46a6b3398308d148c037fdd786e6d45b59bf (diff)
parent07564773c2569d012719ab9e26b9b27251f3d354 (diff)
downloadgit-00e38ba6d801143a10f762d781e3e885243caa42.zip
git-00e38ba6d801143a10f762d781e3e885243caa42.tar.gz
git-00e38ba6d801143a10f762d781e3e885243caa42.tar.bz2
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 'compat')
-rw-r--r--compat/zlib-uncompress2.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/compat/zlib-uncompress2.c b/compat/zlib-uncompress2.c
index 722610b..77a1b08 100644
--- a/compat/zlib-uncompress2.c
+++ b/compat/zlib-uncompress2.c
@@ -1,3 +1,6 @@
+#include "git-compat-util.h"
+
+#if ZLIB_VERNUM < 0x1290
/* taken from zlib's uncompr.c
commit cacf7f1d4e3d44d871b605da3b647f07d718623f
@@ -8,16 +11,11 @@
*/
-#include "../reftable/system.h"
-#define z_const
-
/*
* Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-#include <zlib.h>
-
/* clang-format off */
/* ===========================================================================
@@ -93,3 +91,6 @@ int ZEXPORT uncompress2 (
err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR :
err;
}
+#else
+static void *dummy_variable = &dummy_variable;
+#endif