8000 `unix/prim.c` uses deprecated Apple `TARGET_` symbols · Issue #879 · microsoft/mimalloc · GitHub
[go: up one dir, main page]

Skip to c 8000 ontent
unix/prim.c uses deprecated Apple TARGET_ symbols #879
@freakboy3742

Description

@freakboy3742

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0