mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 10:50:15 -10:00
The companion to the OSX change. The Xcode config passed -DIOS and 126 sites across 40 files tested it. What -DIOS meant is the important part: OTHER_CFLAGS_IOS_TVOS_SHARE carries it to iphoneos, iphonesimulator, appletvos and appletvsimulator alike, so IOS meant "the iPhone family", not iOS as against tvOS. Apple's name for that is TARGET_OS_IPHONE, which is 1 on iOS, tvOS, watchOS and their simulators - TARGET_OS_IOS is 0 on tvOS and would have turned every one of those 126 sites off there. So IOS becomes TARGET_OS_IPHONE, one for one, and nothing changes which branch it takes on any target. menu_displaylist.c's "#if !defined(IOS) || !IOS", which said the same thing twice, becomes one test. The macro now comes from Apple's header rather than a -D, so <TargetConditionals.h> is included, under __MACH__ as config.def.h already did it, by the 42 files that test TARGET_OS_IPHONE or TARGET_OS_OSX and did not include it. The four settings_def fragments are not translation units - they are included into configuration.c, menu_setting.c and msg_hash_us.c, all three of which have it, the last through msg_hash.h. -DIOS is gone from the Xcode config. And the simulator, which is the reason to be careful here rather than after a bug report: iOS SDKs before 9 set TARGET_OS_IPHONE to 0 for a simulator build and marked it with TARGET_IPHONE_SIMULATOR instead, so the TARGET_OS_OSX fallback added in the previous commit would have called an old simulator build a Mac. Both simulator spellings are checked now, the modern TARGET_OS_SIMULATOR and that one. The preprocessor matrix from the previous commit grew two rows - an old iOS-simulator SDK and a modern one - and all thirteen are correct. Linux builds and runs clean under ASan; the Apple side is not compiled here.