mirror of
https://github.com/darlinghq/darling-xnu.git
synced 2024-11-23 12:39:55 +00:00
23 lines
461 B
C
23 lines
461 B
C
#include <spawn.h>
|
|
/*
|
|
* Returns the subcpu type for the architecture for which the
|
|
* binary was compiled.
|
|
*/
|
|
int
|
|
main(void)
|
|
{
|
|
#if defined(__x86_64__)
|
|
return CPU_SUBTYPE_X86_64_ALL;
|
|
#elif __arm64e__
|
|
return CPU_SUBTYPE_ARM64E;
|
|
#elif defined(__arm64__) && defined(__LP64__)
|
|
return CPU_SUBTYPE_ARM64_ALL;
|
|
#elif defined(__arm64__)
|
|
return CPU_SUBTYPE_ARM64_32_ALL;
|
|
#elif defined(__arm__)
|
|
return CPU_SUBTYPE_ARM_V7K;
|
|
#else
|
|
#error unknown architecture
|
|
#endif
|
|
}
|