Closed zixu-w closed 8 months ago
This problem has not been noticed until a recent extension in clang (llvm/llvm-project#74676) exposed the issue and broke zlib builds on Apple platforms.
zlib still compiles fine on the latest clang that Apple delivers, 15.0.0. What version of clang does it break on, and exactly how does it break?
This problem has not been noticed until a recent extension in clang (llvm/llvm-project#74676) exposed the issue and broke zlib builds on Apple platforms.
zlib still compiles fine on the latest clang that Apple delivers, 15.0.0. What version of clang does it break on, and exactly how does it break?
Thanks for taking a look Mark! The open source change will get into a future Apple clang at some point. The build failure can be reproduced currently by adding a line
#include <TargetConditionals.h>
before the #if defined(TARGET_OS_MAC)
check.
Thanks. Fixed.
@madler: I think that some commits are missing since 2023-11-15, can you push it? Thanks in advance.
Note that the #if __APPLE
block further down the same file redefines OS_CODE
.
It is good with the current devel branch?
It is good with the current devel branch?
I believe https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9 resolved the issue so yeah it should be good.
zutils.h
contains configurations that are no longer exercised for the macOS target.TARGET_OS_MAC
covers all Apple targets, including iOS, and it should not be checked with#if defined
as they would always be defined (to either 1 or 0) on Apple platforms.fdopen
, or definesfdopen
as a macro is no longer valid. The null definition inzutils.h
would conflict with the macOS SDK and cause a compilation failure.This problem has not been noticed until a recent extension in clang (https://github.com/llvm/llvm-project/pull/74676) exposed the issue and broke zlib builds on Apple platforms.