Fix namespace build of zlib gzguts.h on macOS

Move ABC_NAMESPACE_HEADER_START (and the abc_global.h include) before the
non-LFS prototype block so the bare gzFile references in gzopen64/gzseek64/
gztell64/gzoffset64 resolve to the namespaced type. Without this, building
with ABC_USE_NAMESPACE=xxx fails on platforms that compile this block (e.g.
macOS, which does not define _LARGEFILE64_SOURCE):

  gzguts.h: error: unknown type name 'gzFile'; did you mean 'xxx::gzFile'?

Restores the header ordering used in the previous zlib 1.2.5 sources.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
This commit is contained in:
Matt Liberty 2026-06-15 17:12:13 +00:00
parent 749bc49826
commit cd9d9fcc13
1 changed files with 4 additions and 4 deletions

View File

@ -138,6 +138,10 @@
# endif
#endif
#include "misc/util/abc_global.h"
ABC_NAMESPACE_HEADER_START
/* provide prototypes for these when building zlib without LFS */
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
@ -163,10 +167,6 @@
#define GZ_WRITE 31153
#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
#include "misc/util/abc_global.h"
ABC_NAMESPACE_HEADER_START
/* values for gz_state how */
#define LOOK 0 /* look for a gzip header */
#define COPY 1 /* copy input directly */