Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

unix/prim.c uses deprecated Apple TARGET_ symbols #879

Closed
freakboy3742 opened this issue Apr 19, 2024 · 1 comment
Closed

unix/prim.c uses deprecated Apple TARGET_ symbols #879

freakboy3742 opened this issue Apr 19, 2024 · 1 comment

Comments

@freakboy3742
Copy link

freakboy3742 commented Apr 19, 2024

The file src/prim/unix/prim.c references 2 preprocessor symbols TARGET_IOS_IPHONE and TARGET_IOS_SIMULATOR.

These symbols don't exist in the macOS 14 or iOS 17 SDKs. I suspect they should be TARGET_OS_IPHONE and TARGET_OS_SIMULATOR.

Alternatively, if the intention is to only include the header on macOS, #if !defined(TARGET_OS_OSX) || TARGET_OS_OSX would allow an explicit check that the platform is macOS (rather than "not not iPhone"), allowing for older macOS SDKs that predate the introduction of TARGET_OS_OSX.

That said, it's also not clear to me that the branch is needed at all, as mach/vm_statistics.h exists in the iOS 17 SDK. However, I'm not sufficiently familiar with what the code is doing in this case to comment. I'm not sure if this wasn't the case on older iOS SDKs.

@daanx
Copy link
Collaborator

daanx commented Apr 19, 2024

Thanks for finding this -- I used your suggested fix and documented why we include mach/vm_statistics.h (a header file from 1991 :-) ). We need it mostly for large OS pages and tagging mimalloc memory but it is not essential so can be left out if the OS variant does not support that.

@daanx daanx closed this as completed May 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants