zlib: Remove custom `git2/zlib.h` header This is legacy compat stuff for when `deflateBound` is not defined, but we're not embedding zlib and that function is always available. Kill that with fire.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
diff --git a/include/git2.h b/include/git2.h
index d68a04e..3d7c4f6 100644
--- a/include/git2.h
+++ b/include/git2.h
@@ -13,7 +13,6 @@
#include "git2/common.h"
#include "git2/threads.h"
#include "git2/errors.h"
-#include "git2/zlib.h"
#include "git2/types.h"
diff --git a/include/git2/zlib.h b/include/git2/zlib.h
deleted file mode 100644
index a28efd9..0000000
--- a/include/git2/zlib.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2009-2012 the libgit2 contributors
- *
- * This file is part of libgit2, distributed under the GNU GPL v2 with
- * a Linking Exception. For full terms see the included COPYING file.
- */
-#ifndef INCLUDE_git_zlib_h__
-#define INCLUDE_git_zlib_h__
-
-#include <zlib.h>
-
-/**
- * @file git2/zlib.h
- * @brief Git data compression routines
- * @defgroup git_zlib Git data compression routines
- * @ingroup Git
- * @{
- */
-GIT_BEGIN_DECL
-
-#if defined(NO_DEFLATE_BOUND) || ZLIB_VERNUM < 0x1200
-/**
- * deflateBound returns an upper bound on the compressed size.
- *
- * This is a stub function used when zlib does not supply the
- * deflateBound() implementation itself.
- *
- * @param stream the stream pointer.
- * @param s total length of the source data (in bytes).
- * @return maximum length of the compressed data.
- */
-GIT_INLINE(size_t) deflateBound(z_streamp stream, size_t s)
-{
- return (s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11);
-}
-#endif
-
-/** @} */
-GIT_END_DECL
-#endif
diff --git a/src/filebuf.h b/src/filebuf.h
index 1e84bbe..3712153 100644
--- a/src/filebuf.h
+++ b/src/filebuf.h
@@ -9,7 +9,7 @@
#include "fileops.h"
#include "hash.h"
-#include "git2/zlib.h"
+#include <zlib.h>
#ifdef GIT_THREADS
# define GIT_FILEBUF_THREADS
diff --git a/src/indexer.c b/src/indexer.c
index c14b8e2..de1e5dc 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -5,9 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include <zlib.h>
+
#include "git2/indexer.h"
#include "git2/object.h"
-#include "git2/zlib.h"
#include "git2/oid.h"
#include "common.h"
diff --git a/src/odb.c b/src/odb.c
index bf6b07f..77287aa 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -6,7 +6,7 @@
*/
#include "common.h"
-#include "git2/zlib.h"
+#include <zlib.h>
#include "git2/object.h"
#include "fileops.h"
#include "hash.h"
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 6cd07f3..bb2b7b5 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -6,7 +6,7 @@
*/
#include "common.h"
-#include "git2/zlib.h"
+#include <zlib.h>
#include "git2/object.h"
#include "git2/oid.h"
#include "fileops.h"
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 3f6bb8e..9e1004e 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -6,7 +6,7 @@
*/
#include "common.h"
-#include "git2/zlib.h"
+#include <zlib.h>
#include "git2/repository.h"
#include "git2/oid.h"
#include "fileops.h"
diff --git a/src/pack.c b/src/pack.c
index fcb097e..0d61832 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -14,7 +14,7 @@
#include "fileops.h"
#include "git2/oid.h"
-#include "git2/zlib.h"
+#include <zlib.h>
static int packfile_open(struct git_pack_file *p);
static off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n);