Commit Graph
90 Commits
Author SHA1 Message Date
LibretroAdmin e5fc0a50e4 apple: the App Store builds compile without warnings, and their uploads stop failing on one bad core
Built the way Xcode builds them - the App Store floors (macOS 12,
iOS/tvOS 15), the projects' warnings, every translation unit - the
tree still warned:

- Delegate methods the SDK deprecates that an older OS still calls
  are no longer implemented in source.  apple_rt_add_method() gives
  the class each one at run time, from +initialize and only on the
  releases that call it: -locationManager:didChangeAuthorizationStatus:
  before macOS 11 / iOS 14 (-locationManagerDidChangeAuthorization:
  from there), -documentPicker:didPickDocumentAtURL: before iOS 11
  (the URL-array method from there), -shouldAutorotateTo-
  InterfaceOrientation: before iOS 6, and NSView's
  -layer:shouldInheritContentsScale:fromWindow: from 10.7.
  class_addMethod is looked up by name, as the 10.4 binary may not
  import it.  CocoaView no longer declares UIDocumentPickerDelegate,
  whose pre-11 SDKs require the method it now adds at run time, and
  -prefersPointerLocked is not built for tvOS, where it is
  unavailable.
- The open panel's file types, the companion's folder icon and the
  cores folder's open are -setAllowedContentTypes:, -iconForContent-
  Type: and -openURL: from macOS 11, the 10.x methods before it, by
  selector where they are not on every release.
- The alert's end selector is looked up by name, and on SDKs older
  than the selectors ui_cocoa.m names (10.6, 10.7, 10.9) they are
  declared in an unimplemented NSObject category, so @selector()
  stays a constant.
- size_t and 64-bit values narrowed without a cast in configuration.c,
  gl3.c, cdrom.c, media_detect_cd.c and vfs_implementation_cdrom.c;
  rchd_read_extent() rejects an extent past the last 32-bit frame
  instead of wrapping into the wrong track.

App Store uploads: one iOS or tvOS core without an unencrypted
LC_ENCRYPTION_INFO_64 - written by Apple's ld, not by other linkers -
fails the whole upload (ITMS-90125).  make-frameworks.sh leaves such a
core out of an App Store build with a warning naming it.  The
Fastfile's check for a build already in TestFlight review passed
Build.all a filter it does not take, so it always failed and the
upload went on to external distribution and stopped there; it asks
App Store Connect for the newest five builds of the platform with
their review submissions instead.
2026-10-07 09:38:29 +02:00
LibretroAdmin 61a2bcbed7 apple: iOS and tvOS reach their newer APIs by selector too
The iOS and tvOS paths take the same treatment as macOS, down to an iOS
12 floor and with deprecations reported: the UIKit, GameController,
MetricKit, AVFoundation and CoreLocation calls above the floor go
through the apple_runtime.h sends behind their OS checks, enum values
newer than the floor are compared by value, and the display link's
frame-rate range is set and read by selector on every platform without
an SDK gate.  apple_runtime.h gains a 9-16 byte struct getter and
-init sends whose casts carry the init family's ownership.

Code that uses a framework throughout - the keypress and device
haptics, camera authorization, speech - moves into classes carrying
its availability, so it calls the framework directly, and is reached
by selector through a class looked up once.  Deprecated calls with a
successor on every floor take it; the rest are sent by selector.  The
iOS display link and GCDWebServer's lastModifiedDate declare their
ownership, and the iOS display link's rate read is guarded for systems
before iOS 10.3.
2026-10-07 06:55:20 +02:00
LibretroAdmin b05f954743 apple: the macOS build reaches newer APIs by selector too
Everything the macOS build calls above its deployment floor goes
through the apple_runtime.h sends behind its existing OS check: the
GameController physical input profile and gesture state, GCMotion's
activation and acceleration, the haptics rumbler's own macOS 11
methods, the CocoaView display link and its frame-rate range, the
location authorisation status, the PQ colour space name, BC texture
support and the screen's maximum frame rate.  Element names and
exported constants are looked up by symbol once, selectors on the poll
paths are cached, and a struct the ABI returns in memory goes through
objc_msgSend_stret everywhere but arm64.  memmap resolves
pthread_jit_write_protect_np at load.

Deprecated spellings with a same-valued successor take the successor,
mapped back in cocoa_defines.h for older SDKs; deprecated calls with
no successor on the floor are sent by selector, and the companion
converts window and screen coordinates by the frame origin.
2026-10-07 06:42:57 +02:00
LibretroAdmin c8280e76c5 (Apple) Replace all @available checks with cached runtime version checks
@available has two problems for RetroArch's range of targets:

1. It needs a clang new enough to know the syntax, so the ancient
   toolchains building the legacy iOS/macOS targets cannot compile
   any file that uses it.
2. It lowers to a call to __isPlatformVersionAtLeast() every time
   it is evaluated, including in per-frame and per-input paths.

Introduce apple_runtime.h with apple_runtime_available(mac, ios,
tvos), a drop-in replacement that resolves the running OS version
exactly once per process and caches it in a static int; after
warm-up every check is a single load and integer compare, cheaper
than @available. Platforms the original check did not list are
passed as 0, preserving @available's semantics of returning true
on unlisted platforms.

The version is read from UIDevice systemVersion on iOS/tvOS (never
shimmed, works on any version), and on macOS from the
kern.osproductversion sysctl - which reports the real OS version
even for binaries linked against pre-11.0 SDKs, where the
NSProcessInfo APIs (and @available's own plist source) are subject
to the 10.16 compatibility shim - with an
operatingSystemVersionString fallback for pre-10.13.4 systems.

This also fixes the broken iOS 9 / iOS 6 CI builds: cocoa_common.m
used UIWindowScene.effectiveGeometry, an iOS 16 API that older SDKs
(e.g. iPhoneOS 14.2) do not declare at all, so @available could not
save compilation. That call chain is now resolved entirely at
runtime via objc_msgSend (identical cost to a compiled property
access), with the capability probe cached in a static.

All 84 live @available sites across 13 files are converted.
Behavior on every OS version is unchanged: the same paths are taken
at the same version thresholds. Swift #available sites are
untouched; Swift enforces availability at compile time and those
files only build on modern toolchains.

Existing compile-time SDK gates (e.g. around NSWorkspace
isVoiceOverEnabled and the Metal HDR blocks) are kept, since they
guard symbol declarations, not runtime dispatch; comments updated
accordingly.
2026-09-16 17:34:16 +02:00
LibretroAdmin 9a1b0c5ca0 apple: TARGET_OS_IPHONE in place of the tree's own IOS define, and the simulator
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.
2026-09-04 04:33:37 +02:00
LibretroAdmin 5e7a500853 location/corelocation: guard 10.15 requestWhenInUseAuthorization
-[CLLocationManager requestWhenInUseAuthorization] is macOS 10.15+ (iOS 8+,
tvOS 9+). Building against the macOS 10.13 deployment target emitted:

  'requestWhenInUseAuthorization' is only available on macOS 10.15 or newer

Wrap the call in if (@available(macOS 10.15, *)), matching the @available
idiom already used in this file. Pre-10.15 macOS has no explicit when-in-use
request API, so the legacy branch starts location updates instead, which
raises the authorization prompt implicitly and preserves behaviour on older
systems.
2026-06-17 20:52:00 +02:00
libretroadmin ab9535c827 Code analysis cleanups/fixes 2025-07-17 22:28:48 +02:00
sonninnos b2ca569521 Logging unification cleanups 2025-07-10 05:59:06 +03:00
Eric Warmenhoven 8bf7e76f45 apple: enable corelocation location driver (#17595) 2025-02-19 04:04:17 +01:00
Joe Mattiello 9438d70ed9 Add CoreLocation location driver for macOS and iOS (#17591)
Signed-off-by: Joseph Mattiello <[email protected]>
2025-02-18 17:12:08 +01:00
twinaphex b87bc46064 Add missing header for Android 2021-09-21 17:00:58 +02:00
twinaphex 8627d638e1 Cleanups 2020-02-04 06:05:00 +01:00
twinaphex 5dcdee5faa Get rid of null camera file and null location file - and buildfix 2020-01-06 14:57:02 +01:00
twinaphex eedc6a6092 Integrate location_driver.c into retroarch.c, get rid of
location_driver_ctl
2019-06-17 11:57:46 +02:00
twinaphex 712115ef9d (Wifi/Location/Camera) Get rid of 'own driver' mechanism 2019-02-27 17:02:33 +01:00
twinaphex f705503531 (Apple) Get rid of HAVE_CORELOCATION/HAVE_AVFOUNDATION - was mostly dormant
code and makes the Apple code needlessly complex right now. We can
always reintroduce this later on when the time is right
2019-02-07 04:03:52 +01:00
natinusala c20ab3864d First version of menu widgets (gl only) 2019-02-06 20:48:24 +01:00
twinaphex 11f26ed549 Refactor verbosity code - try to avoid log calls if verbosity is not
set
2018-01-17 06:28:26 +01:00
gblues 6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
twinaphex 42ebe7a7ad Merge runloop.c and retroarch.c 2017-05-11 09:11:46 +02:00
twinaphex f0c2d786ae Update arrays struct 2017-04-28 22:59:13 +02:00
twinaphex ed53be7c81 Move all bool settings 2017-04-28 14:11:34 +02:00
twinaphex 3ec5816259 Rewrite RUNLOOP_CTL_SYSTEM_INFO_GET 2017-04-23 16:41:26 +02:00
Twinaphex b7b3b2cb5f Try to prevent truckload of warnings on iOS 2017-02-26 10:33:03 +01:00
twinaphex 96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
twinaphex 77e5cdbfde Revert "Rename runloop_msg_queue_push to video_driver_msg_queue_push"
This reverts commit ad7386913c.
2016-12-22 23:36:11 +01:00
twinaphex ad7386913c Rename runloop_msg_queue_push to video_driver_msg_queue_push
and move code to video_driver.c
2016-12-22 13:15:02 +01:00
twinaphex 5c4e3ad87e location_driver_ctl - return 'true' by default 2016-09-29 12:13:46 +02:00
twinaphex c3ba0ba4e9 Revert "Refactor core_system_info_* functions"
This reverts commit f637805c9e.
2016-09-06 08:38:26 +02:00
twinaphex f637805c9e Refactor core_system_info_* functions 2016-09-06 07:08:38 +02:00
twinaphex 82d82110ae Merge system.h with core.h 2016-09-06 06:11:54 +02:00
twinaphex 4571dc33fc header include cleanups 2016-09-05 17:29:19 +02:00
twinaphex ce97d783a7 Some more header cleanups 2016-09-01 17:52:22 +02:00
twinaphex 8ce3c2bbc8 use retro_common_api.h 2016-06-03 05:38:40 +02:00
twinaphex df3b090d7a Revert "Create runloop_get_system_info/runloop_free_system_info/runloop_init_system_info"
This reverts commit 35bf38e05c.
2016-05-12 09:37:21 +02:00
twinaphex 35bf38e05c Create runloop_get_system_info/runloop_free_system_info/runloop_init_system_info 2016-05-12 09:25:52 +02:00
twinaphex f8a7154557 Rename rarch_ functions 2016-05-09 07:09:26 +02:00
twinaphex 61bae588fb Header include changes 2016-03-22 02:45:25 +01:00
twinaphex ac6362cae4 Combine list_special files 2016-03-20 17:28:24 +01:00
twinaphex c717ebdfda Rename callbacks 2016-03-04 20:00:49 +01:00
twinaphex 2cbb18b4e4 Create RARCH_DRIVER_CTL_FIND_INDEX 2016-02-01 13:15:53 +01:00
twinaphex 7a55ae3765 Start updating headers for 2016 2016-01-10 04:06:50 +01:00
twinaphex fc6505e408 Get rid of rarch_system_info_get_ptr 2015-12-10 22:30:25 +01:00
twinaphex 2d55dc3bda Complete namespace changes 2015-12-07 15:32:14 +01:00
Twinaphex 637eb68bed Create RARCH_CAMERA_CTL_DESTROY and RARCH_LOCATION_CTL_DESTROY 2015-12-07 08:05:52 +01:00
twinaphex c6359d6dbc Divorce g_system_menu from global state 2015-12-06 19:31:47 +01:00
twinaphex fadeb4b3e4 Turn some functions static 2015-12-05 23:03:05 +01:00
twinaphex 19a7ee6486 Move header include for location/location_driver.h out of
driver.h
2015-12-05 15:47:33 +01:00
twinaphex 3790b1d566 Move location driver handle data to location_driver.c 2015-12-05 15:44:54 +01:00
twinaphex ade194b1cc Create location_driver_ctl 2015-12-05 15:40:29 +01:00