From 2543565ae1d73b5a444bec173e75768b222c79dd Mon Sep 17 00:00:00 2001 From: azad Date: Mon, 1 Jun 2026 17:01:16 +0000 Subject: [PATCH] [Android] Fix zlib fdopen macro breaking macOS builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On modern macOS, TARGET_OS_MAC is always 1 (set by system headers), causing `#define fdopen(fd,mode) NULL` to fire. This macro replaces the fdopen token everywhere, which breaks when the macOS SDK's _stdio.h declares `FILE *fdopen(int, const char *)` — the compiler sees `FILE *NULL(int, const char *)` and errors out. The #else branch was written for classic Mac OS (pre-OS X) using non-Metrowerks compilers that no longer exist. Modern macOS provides fdopen via the system and needs no macro. Co-Authored-By: Claude Opus 4.6 (1M context) --- third_party/zlib/zutil.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/third_party/zlib/zutil.h b/third_party/zlib/zutil.h index 902a304cc2d913..cc7d7cfdeec313 100644 --- a/third_party/zlib/zutil.h +++ b/third_party/zlib/zutil.h @@ -142,10 +142,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # ifndef Z_SOLO # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif # endif # endif #endif