Skip to content

Fix zlib OS_CODE misidentification on non-macOS Apple platforms #6269

Open
lilinxiong wants to merge 1 commit intogoogle-ai-edge:masterfrom
lilinxiong:feature/zlib-patch
Open

Fix zlib OS_CODE misidentification on non-macOS Apple platforms #6269
lilinxiong wants to merge 1 commit intogoogle-ai-edge:masterfrom
lilinxiong:feature/zlib-patch

Conversation

@lilinxiong
Copy link
Copy Markdown

The zutil.h patch in third_party/zlib.diff currently checks defined(MACOS) || defined(TARGET_OS_MAC) to set OS_CODE to 7 (Macintosh). However, TARGET_OS_MAC is defined as 1 for all Apple
platforms (macOS, iOS, tvOS, watchOS, visionOS) in the Apple SDK headers, not just macOS.

This causes iOS and other non-macOS Apple platform builds to incorrectly use OS_CODE 7 and pull in classic Mac-specific code paths (e.g., macopen() via __MWERKS__ checks), which are not appropriate for
these platforms.

This change removes the TARGET_OS_MAC check, keeping only defined(MACOS) which correctly targets classic Mac OS only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant