Files

75 lines
3.5 KiB
Diff

Remove fdopen #defines in zutil.h.
fdopen() is not used by zlib anymore. The #defines are vestigial.
https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9
Fixes:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:210:7: error: expected identifier or '('
210 | FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
| ^
pdfium/third_party/zlib_v128/zutil.h:128:33: note: expanded from macro 'fdopen'
128 | # define fdopen(fd,mode) NULL /* No fdopen() */
| ^
/opt/local/libexec/llvm-18/lib/clang/18/include/__stddef_null.h:26:16: note: expanded from macro 'NULL'
26 | #define NULL ((void*)0)
| ^
In file included from pdfium/third_party/zlib_v128/zutil.c:10:
In file included from pdfium/third_party/zlib_v128/gzguts.h:21:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:210:7: error: expected ')'
pdfium/third_party/zlib_v128/zutil.h:128:33: note: expanded from macro 'fdopen'
128 | # define fdopen(fd,mode) NULL /* No fdopen() */
| ^
/opt/local/libexec/llvm-18/lib/clang/18/include/__stddef_null.h:26:16: note: expanded from macro 'NULL'
26 | #define NULL ((void*)0)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:210:7: note: to match this '('
pdfium/third_party/zlib_v128/zutil.h:128:33: note: expanded from macro 'fdopen'
128 | # define fdopen(fd,mode) NULL /* No fdopen() */
| ^
/opt/local/libexec/llvm-18/lib/clang/18/include/__stddef_null.h:26:15: note: expanded from macro 'NULL'
26 | #define NULL ((void*)0)
| ^
In file included from pdfium/third_party/zlib_v128/zutil.c:10:
In file included from pdfium/third_party/zlib_v128/gzguts.h:21:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:210:7: error: expected ')'
210 | FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
| ^
pdfium/third_party/zlib_v128/zutil.h:128:33: note: expanded from macro 'fdopen'
128 | # define fdopen(fd,mode) NULL /* No fdopen() */
| ^
/opt/local/libexec/llvm-18/lib/clang/18/include/__stddef_null.h:26:22: note: expanded from macro 'NULL'
26 | #define NULL ((void*)0)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:210:7: note: to match this '('
pdfium/third_party/zlib_v128/zutil.h:128:33: note: expanded from macro 'fdopen'
128 | # define fdopen(fd,mode) NULL /* No fdopen() */
| ^
/opt/local/libexec/llvm-18/lib/clang/18/include/__stddef_null.h:26:14: note: expanded from macro 'NULL'
26 | #define NULL ((void*)0)
| ^
3 errors generated.
--- pdfium/third_party/zlib_v128/zutil.h.orig 2013-03-25 00:47:58.000000000 -0500
+++ pdfium/third_party/zlib_v128/zutil.h 2024-07-12 21:21:11.000000000 -0500
@@ -118,17 +118,8 @@
# endif
#endif
-#if defined(MACOS) || defined(TARGET_OS_MAC)
+#if defined(MACOS)
# define OS_CODE 0x07
-# 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 TOPS20
@