Skip to content

Commit 629188e

Browse files
pks-tgitster
authored andcommitted
compat: introduce new "zlib.h" header
Introduce a new "compat/zlib-compat.h" header that we include instead of including <zlib.h> directly. This will allow us to wire up zlib-ng as an alternative backend for zlib compression in a subsequent commit. Note that we cannot just call the file "compat/zlib.h", as that may otherwise cause us to include that file instead of <zlib.h>. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 27e8960 commit 629188e

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

compat/zlib-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef COMPAT_ZLIB_H
2+
#define COMPAT_ZLIB_H
3+
4+
#include <zlib.h>
5+
6+
#endif /* COMPAT_ZLIB_H */

git-compat-util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ int cmd_main(int, const char **);
15371537
int common_exit(const char *file, int line, int code);
15381538
#define exit(code) exit(common_exit(__FILE__, __LINE__, (code)))
15391539

1540-
#include <zlib.h>
1540+
#include "compat/zlib-compat.h"
15411541

15421542
/*
15431543
* This include must come after system headers, since it introduces macros that

reftable/block.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ license that can be found in the LICENSE file or at
1313
#include "record.h"
1414
#include "reftable-error.h"
1515
#include "system.h"
16-
#include <zlib.h>
16+
#include "compat/zlib-compat.h"
1717

1818
int header_size(int version)
1919
{

0 commit comments

Comments
 (0)