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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-01-28 09:41:29 +01:00
committed by Junio C Hamano
parent 27e8960037
commit 629188ede7
3 changed files with 8 additions and 2 deletions

View File

@@ -1537,7 +1537,7 @@ int cmd_main(int, const char **);
int common_exit(const char *file, int line, int code);
#define exit(code) exit(common_exit(__FILE__, __LINE__, (code)))
#include <zlib.h>
#include "compat/zlib-compat.h"
/*
* This include must come after system headers, since it introduces macros that