We include "compat/zlib.h" in "git-compat-util.h", which is
unnecessarily broad given that we only have a small handful of files
that use the zlib library. Move the header into "git-zlib.h" instead and
adapt users of zlib to include that header.
One exception is the reftable library, as we don't want to use the
Git-specific wrapper of zlib there, so we include "compat/zlib.h"
instead. Furthermore, we move the include into "reftable/system.h" so
that users of the library other than Git can wire up zlib themselves.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
#include "convert.h"
#include "environment.h"
#include "gettext.h"
+#include "git-zlib.h"
#include "hex.h"
#include "object-name.h"
#include "path.h"
#include "convert.h"
#include "environment.h"
#include "gettext.h"
+#include "git-zlib.h"
#include "ident.h"
#include "repository.h"
#include "lockfile.h"
#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
-#include "progress.h"
#include "csum-file.h"
+#include "git-zlib.h"
#include "hash.h"
+#include "progress.h"
static void verify_buffer_or_die(struct hashfile *f,
const void *buf,
#include "convert.h"
#include "environment.h"
#include "gettext.h"
+#include "git-zlib.h"
#include "repository.h"
#include "config.h"
#include "refs.h"
int common_exit(const char *file, int line, int code);
#define exit(code) exit(common_exit(__FILE__, __LINE__, (code)))
-#include "compat/zlib-compat.h"
-
/*
* This include must come after system headers, since it introduces macros that
* replace system names.
#ifndef GIT_ZLIB_H
#define GIT_ZLIB_H
+#include "compat/zlib-compat.h"
+
typedef struct git_zstream {
z_stream z;
unsigned long avail_in;
#include "record.h"
#include "reftable-error.h"
#include "system.h"
-#include "compat/zlib-compat.h"
int header_size(int version)
{
#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
+#include "compat/zlib-compat.h"
/*
* An implementation-specific temporary file. By making this specific to the