mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
37 lines
1.5 KiB
Diff
37 lines
1.5 KiB
Diff
This patch is necessary for compatibility with the Clang compiler in Xcode ≥
|
|
16.3: TARGET_OS_MAC as it was used in zutil.h intends to refer to the Classic
|
|
Mac OS. This macro has long been defined by the macOS SDK to mean modern macOS,
|
|
but was only defined by <TargetConditionals.h>, which was not ordinarily
|
|
#included by any part of the zipfile-deflate64 build.
|
|
https://github.com/llvm/llvm-project/commit/6e1f19168bca7e3bd4eefda50ba03eac8441dbbf
|
|
(2023-12-07, in upstream Clang 18.1, 2024-01-29, and in Xcode 16.3, 2025-03-31)
|
|
now has the compiler itself defining this macro unconditionally for Apple
|
|
targets
|
|
(https://releases.llvm.org/18.1.0/tools/clang/docs/ReleaseNotes.html#clang-frontend-potentially-breaking-changes),
|
|
with the effect of breaking code like this that used the macro in a different
|
|
way. There was some discussion of this at
|
|
https://github.com/madler/zlib/pull/895.
|
|
|
|
https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9
|
|
--- Source/ZLib/zutil.h.orig 2017-02-11 19:07:48.000000000 -0600
|
|
+++ Source/ZLib/zutil.h 2025-10-16 09:21:37.000000000 -0500
|
|
@@ -130,17 +130,8 @@
|
|
# endif
|
|
#endif
|
|
|
|
-#if defined(MACOS) || defined(TARGET_OS_MAC)
|
|
+#if defined(MACOS)
|
|
# define OS_CODE 7
|
|
-# ifndef Z_SOLO
|
|
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
|
|
-# include <unix.h> /* for fdopen */
|
|
-# else
|
|
-# ifndef fdopen
|
|
-# define fdopen(fd,mode) NULL /* No fdopen() */
|
|
-# endif
|
|
-# endif
|
|
-# endif
|
|
#endif
|
|
|
|
#ifdef __acorn
|