From cd9d9fcc1312d1218879c0d3de610c813ed594d7 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Mon, 15 Jun 2026 17:12:13 +0000 Subject: [PATCH] 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 --- src/misc/zlib/gzguts.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/misc/zlib/gzguts.h b/src/misc/zlib/gzguts.h index ed7b81f9c..258708ba5 100644 --- a/src/misc/zlib/gzguts.h +++ b/src/misc/zlib/gzguts.h @@ -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 */