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.
This commit is contained in:
LibretroAdmin authored and libretroadmin committed 2026-09-04 04:33:37 +02:00
1 parent 57fb40140e
commit 9a1b0c5ca0
49 files changed
+275 -140

No files matched your search

@@ -1,5 +1,8 @@
#ifndef STUB_TC_H
#define STUB_TC_H
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifndef TARGET_OS_IPHONE
#define TARGET_OS_IPHONE 0
#endif
+6 -3
View File
@@ -69,6 +69,9 @@
#include "version_git.h"
#include "tasks/task_content.h"
#include <compat/strl.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#define CMD_BUF_SIZE 4096
@@ -1087,7 +1090,7 @@ bool command_load_core(command_t *cmd, const char* arg)
if (!arg || !*arg)
return false;
#ifdef IOS
#if TARGET_OS_IPHONE
{
char exp[PATH_MAX_LENGTH];
fill_pathname_expand_special(exp, arg, sizeof(exp));
@@ -1143,7 +1146,7 @@ bool command_load_content(command_t *cmd, const char* arg)
memcpy(core_path, arg, _len);
core_path[_len] = '\0';
#ifdef IOS
#if TARGET_OS_IPHONE
{
char exp[PATH_MAX_LENGTH];
fill_pathname_expand_special(exp, sep + 1, sizeof(exp));
@@ -1626,7 +1629,7 @@ static size_t command_event_save_config(const char *config_path,
#endif
if (path_exists && config_save_file(config_path))
{
#if IOS
#if TARGET_OS_IPHONE
char tmp[PATH_MAX_LENGTH] = {0};
fill_pathname_abbreviate_special(tmp, config_path, sizeof(tmp));
_len = snprintf(s, len, "%s \"%s\".",
+10 -10
View File
@@ -207,7 +207,7 @@
#define DEFAULT_BLUETOOTH_ERTM false
#endif
#if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !defined(IOS)) || defined(__EMSCRIPTEN__)
#if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !TARGET_OS_IPHONE) || defined(__EMSCRIPTEN__)
#define DEFAULT_MOUSE_ENABLE true
#else
#define DEFAULT_MOUSE_ENABLE false
@@ -1044,7 +1044,7 @@
#define DEFAULT_INPUT_BACKTOUCH_TOGGLE false
#endif
#if defined(ANDROID) || defined(IOS)
#if defined(ANDROID) || TARGET_OS_IPHONE
#define DEFAULT_OVERLAY_ENABLE_AUTOPREFERRED true
#else
#define DEFAULT_OVERLAY_ENABLE_AUTOPREFERRED false
@@ -1434,7 +1434,7 @@
/* Saves non-volatile SRAM at a regular interval.
* It is measured in seconds. A value of 0 disables autosave. */
#if defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || TARGET_OS_OSX || defined(ANDROID) || defined(IOS) || defined(DINGUX)
#if defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || TARGET_OS_OSX || defined(ANDROID) || TARGET_OS_IPHONE || defined(DINGUX)
/* Flush to file every 10 seconds on modern platforms by default */
#define DEFAULT_AUTOSAVE_INTERVAL 10
#else
@@ -1537,7 +1537,7 @@
/* Automatically saves a savestate at a regular interval.
* It is measured in seconds. A value of 0 disables automatic savestate saving. */
#if defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || TARGET_OS_OSX || defined(ANDROID) || defined(IOS) || defined(DINGUX)
#if defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || TARGET_OS_OSX || defined(ANDROID) || TARGET_OS_IPHONE || defined(DINGUX)
/* Disabled by default but can be enabled by user */
#define DEFAULT_SAVESTATE_AUTOMATIC_INTERVAL 0
#else
@@ -1599,7 +1599,7 @@
* updated via the online updater
* > Enable by default on all modern platforms with
* online updater support */
#if defined(HAVE_ONLINE_UPDATER) && (defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || TARGET_OS_OSX || defined(ANDROID) || defined(IOS))
#if defined(HAVE_ONLINE_UPDATER) && (defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || TARGET_OS_OSX || defined(ANDROID) || TARGET_OS_IPHONE)
#define DEFAULT_CORE_UPDATER_AUTO_BACKUP true
#else
#define DEFAULT_CORE_UPDATER_AUTO_BACKUP false
@@ -1816,7 +1816,7 @@
#define DEFAULT_XMB_THUMBNAIL_SCALE_FACTOR 100
#ifdef IOS
#if TARGET_OS_IPHONE
#define DEFAULT_UI_COMPANION_START_ON_BOOT false
#else
#define DEFAULT_UI_COMPANION_START_ON_BOOT true
@@ -1845,7 +1845,7 @@
#define DEFAULT_UI_MENUBAR_ENABLE true
#if defined(__QNX__) || defined(_XBOX1) || defined(_XBOX360) || (defined(__MACH__) && defined(IOS)) || defined(ANDROID) || defined(WIIU) || defined(HAVE_NEON) || defined(GEKKO) || defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(__PS3__)
#if defined(__QNX__) || defined(_XBOX1) || defined(_XBOX360) || (defined(__MACH__) && TARGET_OS_IPHONE) || defined(ANDROID) || defined(WIIU) || defined(HAVE_NEON) || defined(GEKKO) || defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(__PS3__)
#define DEFAULT_AUDIO_RESAMPLER_QUALITY_LEVEL RESAMPLER_QUALITY_LOWER
#elif defined(PSP) || defined(_3DS) || defined(VITA) || defined(PS2) || defined(DINGUX)
#define DEFAULT_AUDIO_RESAMPLER_QUALITY_LEVEL RESAMPLER_QUALITY_LOWEST
@@ -1870,13 +1870,13 @@
/* Only applies to Android 7.0 (API 24) and up */
#define DEFAULT_SUSTAINED_PERFORMANCE_MODE false
#if defined(ANDROID) || defined(IOS)
#if defined(ANDROID) || TARGET_OS_IPHONE
#define DEFAULT_VIBRATE_ON_KEYPRESS true
#else
#define DEFAULT_VIBRATE_ON_KEYPRESS false
#endif
#if defined(IOS)
#if TARGET_OS_IPHONE
#define DEFAULT_ENABLE_DEVICE_VIBRATION true
#else
#define DEFAULT_ENABLE_DEVICE_VIBRATION false
@@ -1934,7 +1934,7 @@
#endif
#elif defined(__QNX__)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/blackberry/latest/"
#elif defined(IOS)
#elif TARGET_OS_IPHONE
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/apple/ios/latest/"
#elif TARGET_OS_OSX
#if defined(__x86_64__)
+6 -3
View File
@@ -85,6 +85,9 @@ void android_app_set_window_settings(bool notch_write_over,
#ifdef HAVE_LAKKA
#include <time.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
/* Compile-time upper bounds for setting array sizes.
@@ -795,7 +798,7 @@ static const enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_NULL;
#if (defined(_3DS) || defined(DINGUX)) && defined(HAVE_RGUI)
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_RGUI;
#elif defined(IOS) && !TARGET_OS_TV
#elif TARGET_OS_IPHONE && !TARGET_OS_TV
#define MENU_DEFAULT_DRIVER (ios_running_on_ipad() ? MENU_OZONE : MENU_MATERIALUI)
#elif defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE)
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_MATERIALUI;
@@ -6622,7 +6625,7 @@ static bool config_load_file(global_t *global,
strlcpy(path_settings[i].ptr, tmp_str, PATH_MAX_LENGTH);
}
#if !IOS
#if !TARGET_OS_IPHONE
if (config_get_path(conf, "libretro_directory", tmp_str, sizeof(tmp_str)))
configuration_set_string(settings,
settings->paths.directory_libretro, tmp_str);
@@ -9363,7 +9366,7 @@ int8_t config_save_overrides(enum override_type type,
if (!string_is_equal(base, cur))
{
#if IOS
#if TARGET_OS_IPHONE
if (string_is_equal(path_settings[i].ident, "libretro_directory"))
continue;
#endif
+4 -1
View File
@@ -38,6 +38,9 @@
#endif
#include "msg_hash.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#define configuration_set_float(settings, var, newvar) \
{ \
@@ -607,7 +610,7 @@ typedef struct settings
bool audio_fastforward_speedup;
bool audio_fastpath_s16;
bool audio_rewind_mute;
#ifdef IOS
#if TARGET_OS_IPHONE
bool audio_respect_silent_mode;
#endif
+4 -1
View File
@@ -46,6 +46,9 @@
#if defined(ANDROID)
#include "play_feature_delivery/play_feature_delivery.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
/*************************/
@@ -1672,7 +1675,7 @@ static size_t core_info_get_file_id(const char *core_filename,
* or platform-specific suffix */
/* > Remove extension */
_len = fill_pathname(s, core_filename, "", len);
#if defined(IOS) || TARGET_OS_OSX
#if TARGET_OS_IPHONE || TARGET_OS_OSX
/* iOS framework names, to quote Apple:
* "must contain only alphanumerics, dots, hyphens and must not end with a dot."
*
+8 -5
View File
@@ -46,7 +46,7 @@
#include <IOKit/ps/IOPSKeys.h>
#include <sys/sysctl.h>
#elif defined(IOS)
#elif TARGET_OS_IPHONE
#include <UIKit/UIDevice.h>
#include <sys/sysctl.h>
#endif
@@ -82,6 +82,9 @@
#include "../../ui/ui_companion_driver.h"
#include "../../paths.h"
#include <compat/strl.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
typedef enum
{
@@ -163,7 +166,7 @@ void CFTemporaryDirectory(char *s, size_t len)
CFStringGetCString(path, s, len, kCFStringEncodingUTF8);
}
#if defined(IOS)
#if TARGET_OS_IPHONE
void get_ios_version(int *major, int *minor);
#endif
@@ -280,7 +283,7 @@ static void darwin_check_power_source(
static void frontend_darwin_get_name(char *s, size_t len)
{
#if defined(IOS)
#if TARGET_OS_IPHONE
struct utsname buffer;
if (uname(&buffer) == 0)
strlcpy(s, buffer.machine, len);
@@ -295,7 +298,7 @@ static void frontend_darwin_get_name(char *s, size_t len)
static size_t frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
{
size_t _len;
#if defined(IOS)
#if TARGET_OS_IPHONE
get_ios_version(major, minor);
#if TARGET_OS_TV
_len = strlcpy_lit(s, "tvOS", len);
@@ -416,7 +419,7 @@ static void frontend_darwin_get_env(int *argc, char *argv[],
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], application_data, "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
#elif TARGET_OS_OSX && defined(HAVE_APPLE_STORE)
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], bundle_path_buf, "Contents/Frameworks", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
#elif defined(IOS) && defined(HAVE_FRAMEWORKS)
#elif TARGET_OS_IPHONE && defined(HAVE_FRAMEWORKS)
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], bundle_path_buf, "Frameworks", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
#else
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], bundle_path_buf, "modules", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
+4 -1
View File
@@ -32,6 +32,9 @@
#endif
#include "frontend_driver.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifndef __WINRT__
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
@@ -177,7 +180,7 @@ size_t frontend_driver_get_core_extension(char *s, size_t len)
#ifdef HAVE_DYNAMIC
#ifdef _WIN32
return strlcpy_lit(s, "dll", len);
#elif (defined(IOS) && defined(HAVE_FRAMEWORKS)) || (TARGET_OS_OSX && defined(HAVE_APPLE_STORE))
#elif (TARGET_OS_IPHONE && defined(HAVE_FRAMEWORKS)) || (TARGET_OS_OSX && defined(HAVE_APPLE_STORE))
return strlcpy_lit(s, "framework", len);
#elif defined(__APPLE__) || defined(__MACH__)
return strlcpy_lit(s, "dylib" ,len);
+3 -3
View File
@@ -13,7 +13,7 @@
*/
#import <TargetConditionals.h>
#ifdef IOS
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <AppKit/AppKit.h>
@@ -249,7 +249,7 @@ static bool apple_display_server_set_resolution(void *data,
view.displayLink.preferredFrameRateRange = CAFrameRateRangeMake(hz * 0.9, hz * 1.2, hz);
return true;
}
#elif defined(IOS)
#elif TARGET_OS_IPHONE
static bool apple_display_server_set_resolution(void *data,
unsigned width, unsigned height, int int_hz, float hz,
int center, int monitor_index, int xoffset, int padjust)
@@ -584,7 +584,7 @@ static void *apple_display_server_init(void)
&& settings->floats.video_refresh_rate >= 10.0f
&& settings->floats.video_refresh_rate <= 250.0f)
{
#if defined(IOS)
#if TARGET_OS_IPHONE
float hz = settings->floats.video_refresh_rate;
CocoaView *view = [CocoaView get];
if (view && view.displayLink)
+4 -1
View File
@@ -85,6 +85,9 @@
#ifdef VITA
#include <defines/psp_defines.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#define GL_RGBA8 GL_RGBA
#define GL_RGB8 GL_RGB
@@ -1346,7 +1349,7 @@ static void *gl1_init(const video_info_t *video,
gl1->ctx_driver->get_video_size(gl1->ctx_data,
&mode_width, &mode_height);
#if defined(__APPLE__) && !defined(IOS)
#if defined(__APPLE__) && !TARGET_OS_IPHONE
/* This is a hack for now to work around a very annoying
* issue that currently eludes us. */
if ( !gl1->ctx_driver->set_video_mode
+9 -6
View File
@@ -86,6 +86,9 @@
#endif
#ifdef HAVE_GFX_WIDGETS
#include "../gfx_widgets.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#ifndef GL_UNSIGNED_INT_8_8_8_8_REV
@@ -183,7 +186,7 @@
#ifndef GL_BGRA8_EXT
#define GL_BGRA8_EXT 0x93A1
#endif
#ifdef IOS
#if TARGET_OS_IPHONE
/* Stupid Apple */
#define RARCH_GL_INTERNAL_FORMAT32 GL_RGBA
#else
@@ -462,7 +465,7 @@ static void gl2_set_viewport(gl2_t *gl,
unsigned vp_width, unsigned vp_height,
bool force_full, bool allow_rotate);
#ifdef IOS
#if TARGET_OS_IPHONE
/* There is no default frame buffer on iOS. */
void glkitview_bind_fbo(void);
#define gl2_renderchain_bind_backbuffer() glkitview_bind_fbo()
@@ -1353,7 +1356,7 @@ static void gl2_size_format(GLint* internalFormat)
#endif
}
#if !defined(HAVE_PSGL) && !defined(ORBIS) && !defined(VITA) && !defined(IOS)
#if !defined(HAVE_PSGL) && !defined(ORBIS) && !defined(VITA) && !TARGET_OS_IPHONE
static bool gl2_tex_storage_allowed(void)
{
static int allowed = -1;
@@ -1405,7 +1408,7 @@ static void gl2_load_texture_image(GLenum target,
GLenum type,
const GLvoid * data)
{
#if !defined(HAVE_PSGL) && !defined(ORBIS) && !defined(VITA) && !defined(IOS)
#if !defined(HAVE_PSGL) && !defined(ORBIS) && !defined(VITA) && !TARGET_OS_IPHONE
#ifdef HAVE_OPENGLES2
enum gl_capability_enum cap = GL_CAPS_TEX_STORAGE_EXT;
#else
@@ -3984,7 +3987,7 @@ static bool gl2_frame(void *data, const void *frame,
gl->shader->use(gl, gl->shader_data, 1, true);
#ifdef IOS
#if TARGET_OS_IPHONE
/* Apparently the viewport is lost each frame, thanks Apple. */
gl2_set_viewport(gl, width, height, false, true);
#endif
@@ -5062,7 +5065,7 @@ static void *gl2_init(const video_info_t *video,
|| !gl->ctx_driver->set_video_mode(gl->ctx_data,
win_width, win_height, (video->fullscreen || force_fullscreen)))
goto error;
#if defined(__APPLE__) && !defined(IOS) && !defined(HAVE_COCOA_METAL)
#if defined(__APPLE__) && !TARGET_OS_IPHONE && !defined(HAVE_COCOA_METAL)
/* This is a hack for now to work around a very annoying
* issue that currently eludes us. */
if ( !gl->ctx_driver->set_video_mode
+4 -1
View File
@@ -63,6 +63,9 @@
#endif
#ifdef HAVE_GFX_WIDGETS
#include "../gfx_widgets.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#define GL3_SET_TEXTURE_COORDS(coords, xamt, yamt) \
@@ -4650,7 +4653,7 @@ static bool gl3_frame(void *data, const void *frame,
if (gl->chain.active)
gl->chain.shader->use(gl, gl->chain.shader_data, 1, true);
#ifdef IOS
#if TARGET_OS_IPHONE
/* Apparently the viewport is lost each frame, thanks Apple. */
gl3_set_viewport(gl, width, height, false, true);
#endif
+4 -1
View File
@@ -25,7 +25,7 @@
#include "../../config.h"
#endif
#ifdef IOS
#if TARGET_OS_IPHONE
#include <CoreText/CoreText.h>
#include <CoreGraphics/CoreGraphics.h>
#else
@@ -34,6 +34,9 @@
#include "../font_driver.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#define CT_ATLAS_ROWS 16
#define CT_ATLAS_COLS 16
+5 -2
View File
@@ -74,6 +74,9 @@
#include "../configuration.h"
#include "video_shader_parse.h"
#include <compat/strl.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#define TIME_TO_FPS(last_time, new_time, frames) ((1000000.0f * (frames)) / ((new_time) - (last_time)))
@@ -3304,7 +3307,7 @@ bool video_driver_is_hw_context(void)
bool video_driver_render_context_is_main_thread_only(void)
{
#ifdef IOS
#if TARGET_OS_IPHONE
/* The iOS Cocoa GL/GLES backends ("gl", "glcore") render through a
* GLKView, whose drawable and backing CAEAGLLayer may only be touched
* on the main thread. With threaded video, swap_buffers and the
@@ -3336,7 +3339,7 @@ bool video_driver_render_context_is_main_thread_only(void)
if (ident && (string_is_equal(ident, "gl")
|| string_is_equal(ident, "glcore")))
return true;
#endif /* IOS */
#endif /* TARGET_OS_IPHONE */
return false;
}
+4 -1
View File
@@ -13,7 +13,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef IOS
#if TARGET_OS_IPHONE
#include <Availability.h>
#else
#include <AvailabilityMacros.h>
@@ -87,4 +87,7 @@
#if defined(HAVE_CLOUDSYNC) && defined(HAVE_ICLOUD_DRIVE)
#include "../network/cloud_sync/icloud_drive.m"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
+7 -4
View File
@@ -34,6 +34,9 @@
#include "../drivers_keyboard/keyboard_event_apple.h"
#include "../../ui/drivers/cocoa/cocoa_common.h"
#include "../../ui/ui_companion_driver.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifdef HAVE_COREMOTION
#import <CoreMotion/CoreMotion.h>
@@ -416,7 +419,7 @@ static void cocoa_input_poll(void *data)
{
uint32_t i;
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
#ifndef IOS
#if !TARGET_OS_IPHONE
float backing_scale_factor = cocoa_screen_get_backing_scale_factor();
#else
int backing_scale_factor = 1;
@@ -469,7 +472,7 @@ static int16_t cocoa_lightgun_aiming_state(
int16_t x = apple->window_pos_x;
int16_t y = apple->window_pos_y;
#ifndef IOS
#if !TARGET_OS_IPHONE
x *= cocoa_screen_get_backing_scale_factor();
y *= cocoa_screen_get_backing_scale_factor();
#endif
@@ -608,7 +611,7 @@ static int16_t cocoa_input_state(
case RETRO_DEVICE_ID_MOUSE_X:
if (device == RARCH_DEVICE_MOUSE_SCREEN)
{
#ifdef IOS
#if TARGET_OS_IPHONE
return apple->window_pos_x;
#else
return apple->window_pos_x * cocoa_screen_get_backing_scale_factor();
@@ -618,7 +621,7 @@ static int16_t cocoa_input_state(
case RETRO_DEVICE_ID_MOUSE_Y:
if (device == RARCH_DEVICE_MOUSE_SCREEN)
{
#ifdef IOS
#if TARGET_OS_IPHONE
return apple->window_pos_y;
#else
return apple->window_pos_y * cocoa_screen_get_backing_scale_factor();
+4 -1
View File
@@ -30,6 +30,9 @@
#include "../connect/joypad_connection.h"
#include "../../tasks/tasks_internal.h"
#include "../../verbosity.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
typedef struct apple_input_rec
{
@@ -692,7 +695,7 @@ static void iohidmanager_hid_device_add(IOHIDDeviceRef device, iohidmanager_hid_
IOHIDDeviceScheduleWithRunLoop(device, CFRunLoopGetCurrent(),
kCFRunLoopCommonModes);
#ifndef IOS
#if !TARGET_OS_IPHONE
iohidmanager_hid_device_get_product_string(device, adapter->name,
sizeof(adapter->name));
#endif
+4 -1
View File
@@ -29,6 +29,9 @@
#include "../../verbosity.h"
#include "../../input/input_driver.h"
#include "../../tasks/tasks_internal.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifndef MAX_MFI_CONTROLLERS
#define MAX_MFI_CONTROLLERS 4
@@ -67,7 +70,7 @@ static bool mfi_inited;
static bool apple_gamecontroller_available(void)
{
#if defined(IOS)
#if TARGET_OS_IPHONE
int major, minor;
get_ios_version(&major, &minor);
+4 -1
View File
@@ -79,6 +79,9 @@
#include "../ai/game_ai.h"
#include <compat/strl.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
/* Force a helper out of line even though it has a single call site.
* Follows the RXML_NOINLINE precedent in
@@ -4471,7 +4474,7 @@ INPUT_NOINLINE static void input_poll_overlay(
/* Block other touchscreen input as needed. */
if ( button_pressed
#ifdef IOS
#if TARGET_OS_IPHONE
|| (ptr_state->device_mask & (1 << RETRO_DEVICE_LIGHTGUN))
|| (ol->flags & INPUT_OVERLAY_BLOCKED))
#else
+4 -1
View File
@@ -41,6 +41,9 @@
#if !defined(ORBIS)
#include <dlfcn.h>
#include <compat/strl.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#endif
@@ -131,7 +134,7 @@ dylib_t dylib_load(const char *path)
#elif defined(ORBIS)
int res;
dylib_t lib = (dylib_t)sceKernelLoadStartModule(path, 0, NULL, 0, NULL, &res);
#elif defined(IOS) || TARGET_OS_OSX
#elif TARGET_OS_IPHONE || TARGET_OS_OSX
dylib_t lib;
static const char fw_suffix[] = ".framework";
if (string_ends_with(path, fw_suffix))
@@ -64,7 +64,7 @@ NS_INLINE CF_RETURNS_RETAINED CFTypeRef CFBridgingRetainCompat(id X)
#endif
#ifdef IOS
#if TARGET_OS_IPHONE
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
@@ -79,6 +79,9 @@ NS_INLINE CF_RETURNS_RETAINED CFTypeRef CFBridgingRetainCompat(id X)
#ifdef __OBJC__
#include <objc/objc-runtime.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#endif
@@ -38,6 +38,12 @@
* the iPhone entirely, means macOS by the same reasoning. tvOS and
* watchOS set TARGET_OS_IPHONE, so they land on the right side too.
*
* The simulator is the exception that has to be named: iOS SDKs
* before iOS 9 set TARGET_OS_IPHONE to 0 for a simulator build and
* marked it with TARGET_IPHONE_SIMULATOR instead, so a bare
* TARGET_OS_IPHONE test would call the old simulator a Mac. Both
* simulator spellings are checked, the modern one and that one.
*
* Not defined off Apple, where #if reads it as 0.
*
* No line continuations here: this file has CRLF endings and a
@@ -45,6 +51,10 @@
#if defined(__APPLE__) && !defined(TARGET_OS_OSX)
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#define TARGET_OS_OSX 0
#elif defined(TARGET_OS_SIMULATOR) && TARGET_OS_SIMULATOR
#define TARGET_OS_OSX 0
#elif defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
#define TARGET_OS_OSX 0
#else
#define TARGET_OS_OSX 1
#endif
@@ -23,7 +23,7 @@
#ifndef RGLGEN_PRIVATE_HEADERS_H__
#define RGLGEN_PRIVATE_HEADERS_H__
#if defined(IOS)
#if TARGET_OS_IPHONE
#if defined(HAVE_OPENGLES3)
#include <OpenGLES/ES3/gl.h>
@@ -70,6 +70,9 @@
/* We need to avoid including <GL/gl.h> on this platform */
#include "switch/nx_gl.h"
#include <GL/glext.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif /* SWITCH */
#endif
@@ -49,8 +49,11 @@
#include <compat/msvc.h>
#endif
#ifdef IOS
#if TARGET_OS_IPHONE
#include <sys/param.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
/**
+5 -2
View File
@@ -38,6 +38,9 @@
#include <retro_dirent.h>
#include <retro_miscellaneous.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
static int qstrcmp_plain(const void *a_, const void *b_)
{
@@ -270,7 +273,7 @@ static int dir_list_read_ctx(size_t dir_len, struct dir_list_ctx *ctx)
if (!ctx->include_hidden && strcmp(name, "System Volume Information") == 0)
continue;
#if defined(IOS) || TARGET_OS_OSX
#if TARGET_OS_IPHONE || TARGET_OS_OSX
{
size_t name_len = strlen(name);
if (name_len >= 10
@@ -535,7 +538,7 @@ int dir_list_iter_step(dir_list_iter_t *iter,
if (!iter->include_hidden && strcmp(name, "System Volume Information") == 0)
continue;
#if defined(IOS) || TARGET_OS_OSX
#if TARGET_OS_IPHONE || TARGET_OS_OSX
{
size_t name_len = strlen(name);
if (name_len >= 10
+5 -2
View File
@@ -87,6 +87,9 @@
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#ifdef __HAIKU__
#include <kernel/image.h>
@@ -786,7 +789,7 @@ libretro_vfs_implementation_file *retro_vfs_file_open_impl(
default:
if (!(fp = (FILE*)fopen_utf8(path, mode_str)))
{
#ifdef IOS
#if TARGET_OS_IPHONE
if (errno == EEXIST)
{
retro_vfs_file_remove_impl(path);
@@ -2329,7 +2332,7 @@ int retro_vfs_mkdir_impl(const char *dir)
free(dir_w);
}
#endif
#elif defined(IOS)
#elif TARGET_OS_IPHONE
int ret = mkdir(dir, 0755);
#elif defined(VITA)
int ret = sceIoMkdir(dir, 0777);
+3
View File
@@ -17,6 +17,9 @@
#include "../../location_driver.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
@interface CoreLocationManager : NSObject <CLLocationManagerDelegate>
@property (strong, nonatomic) CLLocationManager *locationManager;
@property (assign) double latitude;
+5 -2
View File
@@ -36,6 +36,9 @@
#include "../../manual_content_scan.h"
#include "../../verbosity.h"
#include "../../msg_hash_lbl_str.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
enum
{
@@ -339,7 +342,7 @@ static int general_push(menu_displaylist_info_t *info,
* join that onto the parent directory. */
if (path_is_absolute(menu->scratch_buf))
{
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(tmp_str, menu->scratch_buf,
PATH_MAX_LENGTH);
#else
@@ -348,7 +351,7 @@ static int general_push(menu_displaylist_info_t *info,
}
else
{
#if IOS
#if TARGET_OS_IPHONE
char *tmp_path = gb->tmp_path;
fill_pathname_expand_special(tmp_path,
menu->scratch2_buf, PATH_MAX_LENGTH);
+4 -1
View File
@@ -60,6 +60,9 @@
#ifdef HAVE_MIST
#include "../../steam/steam.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#ifndef BIND_ACTION_GET_VALUE
@@ -1243,7 +1246,7 @@ static size_t menu_action_setting_disp_set_label_menu_file_directory(
char *s2, size_t len2)
{
size_t _len = 0;
#if IOS
#if TARGET_OS_IPHONE
char tmp[256];
fill_pathname_abbreviate_special(tmp, path, sizeof(tmp));
MENU_ACTION_SETTING_GENERIC_DISP_SET_LABEL_2(w, s, len,
+17 -14
View File
@@ -88,6 +88,9 @@
#endif
#include "../../gfx/video_display_server.h"
#include "../../manual_content_scan.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifdef HAVE_NETWORKING
#include "../../network/netplay/netplay.h"
@@ -99,7 +102,7 @@
#ifdef __WINRT__
#include "../../uwp/uwp_func.h"
#endif
#ifdef IOS
#if TARGET_OS_IPHONE
#include "../../ui/drivers/cocoa/apple_platform.h"
#endif
@@ -1025,7 +1028,7 @@ int generic_action_ok_displaylist_push(
case ACTION_OK_DL_OPEN_ARCHIVE_DETECT_CORE:
if (menu)
{
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(tmp, menu->scratch2_buf, sizeof(tmp));
menu_path = tmp;
#else
@@ -1573,7 +1576,7 @@ int generic_action_ok_displaylist_push(
if (path && menu_path)
{
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(parent_dir, menu_path, sizeof(parent_dir));
fill_pathname_join_special(tmp,
parent_dir, path, sizeof(tmp));
@@ -1589,7 +1592,7 @@ int generic_action_ok_displaylist_push(
fill_pathname_parent_dir(parent_dir,
parent_dir, sizeof(parent_dir));
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_abbreviate_special(tmp, parent_dir, sizeof(tmp));
strlcpy(parent_dir, tmp, sizeof(parent_dir));
#endif
@@ -2146,7 +2149,7 @@ static int file_load_with_detect_core_wrapper(
{
menu_content_ctx_defer_info_t def_info;
#if IOS
#if TARGET_OS_IPHONE
char tmp_path[PATH_MAX_LENGTH];
#endif
char menu_path_new[PATH_MAX_LENGTH];
@@ -2158,7 +2161,7 @@ static int file_load_with_detect_core_wrapper(
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL, NULL);
#if IOS
#if TARGET_OS_IPHONE
if (menu_path)
{
fill_pathname_expand_special(tmp_path, menu_path, sizeof(tmp_path));
@@ -2176,7 +2179,7 @@ static int file_load_with_detect_core_wrapper(
strlcpy(menu_path_new, menu->scratch_buf, sizeof(menu_path_new));
else
{
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_join_special(tmp_path,
menu->scratch2_buf, menu->scratch_buf, sizeof(tmp_path));
fill_pathname_expand_special(menu_path_new, tmp_path, sizeof(menu_path_new));
@@ -2358,7 +2361,7 @@ static int generic_action_ok(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx,
unsigned id, enum msg_hash_enums flush_id)
{
#if IOS
#if TARGET_OS_IPHONE
char tmp_path[PATH_MAX_LENGTH];
#endif
char action_path[PATH_MAX_LENGTH];
@@ -2384,7 +2387,7 @@ static int generic_action_ok(const char *path,
menu_entries_get_last_stack(&menu_path,
&menu_label, NULL, &enum_idx, NULL);
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(tmp_path, menu_path, sizeof(tmp_path));
menu_path = tmp_path;
#endif
@@ -4436,7 +4439,7 @@ static int action_ok_path_scan_directory(const char *path,
static int action_ok_path_manual_scan_directory(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
#if IOS
#if TARGET_OS_IPHONE
char dir_path[DIR_MAX_LENGTH];
#endif
char content_dir[DIR_MAX_LENGTH];
@@ -4449,7 +4452,7 @@ static int action_ok_path_manual_scan_directory(const char *path,
{
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL);
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(dir_path, menu_path, sizeof(dir_path));
menu_path = dir_path;
#endif
@@ -7401,7 +7404,7 @@ int action_ok_push_filebrowser_list_dir_select(const char *path,
{
menu_entry_t entry;
char current_value[PATH_MAX_LENGTH];
#if IOS
#if TARGET_OS_IPHONE
char tmp[PATH_MAX_LENGTH];
#endif
struct menu_state *menu_st = menu_state_get_ptr();
@@ -7422,7 +7425,7 @@ int action_ok_push_filebrowser_list_dir_select(const char *path,
menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true);
strlcpy(current_value, entry.value, sizeof(current_value));
}
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(tmp, current_value, sizeof(tmp));
if (!path_is_directory(tmp))
current_value[0] = '\0';
@@ -8445,7 +8448,7 @@ static int action_ok_load_archive_detect_core(const char *path,
menu_path = menu->scratch2_buf;
content_path = menu->scratch_buf;
#if IOS
#if TARGET_OS_IPHONE
char tmp_path[PATH_MAX_LENGTH];
fill_pathname_expand_special(tmp_path, menu_path, sizeof(tmp_path));
menu_path = tmp_path;
+7 -4
View File
@@ -31,6 +31,9 @@
#include "../../config.def.h"
#include "../../configuration.h"
#include "../../tasks/tasks_internal.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifndef BIND_ACTION_SCAN
#define BIND_ACTION_SCAN(cbs, name) (cbs)->action_scan = (name)
@@ -50,7 +53,7 @@ void handle_dbscan_finished(retro_task_t *task,
int action_scan_file(const char *path,
const char *label, unsigned type, size_t idx)
{
#if IOS
#if TARGET_OS_IPHONE
char dir_path[DIR_MAX_LENGTH];
#endif
char fullpath[PATH_MAX_LENGTH];
@@ -62,7 +65,7 @@ int action_scan_file(const char *path,
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL);
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(dir_path, menu_path, sizeof(dir_path));
menu_path = dir_path;
#endif
@@ -83,7 +86,7 @@ int action_scan_file(const char *path,
int action_scan_directory(const char *path,
const char *label, unsigned type, size_t idx)
{
#if IOS
#if TARGET_OS_IPHONE
char dir_path[DIR_MAX_LENGTH];
#endif
char fullpath[PATH_MAX_LENGTH];
@@ -95,7 +98,7 @@ int action_scan_directory(const char *path,
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL);
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(dir_path, menu_path, sizeof(dir_path));
menu_path = dir_path;
#endif
+4 -1
View File
@@ -33,6 +33,9 @@
#endif
#include "../../audio/audio_driver.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifndef BIND_ACTION_GET_TITLE
#define BIND_ACTION_GET_TITLE(cbs, name) (cbs)->action_get_title = (name)
@@ -948,7 +951,7 @@ static int action_get_title_default(const char *path, const char *label,
_len += 2;
s[_len] = '\0';
}
#if IOS
#if TARGET_OS_IPHONE
fill_pathname_abbreviate_special(s + _len, path, len - _len);
#else
strlcpy(s + _len, path, len - _len);
+17 -14
View File
@@ -75,7 +75,7 @@
#include "../play_feature_delivery/play_feature_delivery.h"
#endif
#ifdef IOS
#if TARGET_OS_IPHONE
#include "JITSupport.h"
#endif
@@ -88,6 +88,9 @@
#include "../midi_driver.h"
#include "../record/record_driver.h"
#include "../msg_hash_lbl_str.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#include "menu_cbs.h"
#include "menu_driver.h"
#include "menu_dirwalk.h"
@@ -286,7 +289,7 @@ static int filebrowser_parse(
bool path_is_compressed = path && *path
&& path_is_compressed_file(path);
menu_search_terms_t *search_terms = menu_entries_search_get_terms();
#ifdef IOS
#if TARGET_OS_IPHONE
char full_path[PATH_MAX_LENGTH];
fill_pathname_expand_special(full_path, path, sizeof(full_path));
#else
@@ -334,7 +337,7 @@ static int filebrowser_parse(
filter_ext = false;
if ( !strcmp(label, "database_manager_list")
#ifdef IOS
#if TARGET_OS_IPHONE
|| !strcmp(label, "video_filter")
|| !strcmp(label, "audio_dsp_plugin")
#endif
@@ -597,7 +600,7 @@ static int filebrowser_parse(
MENU_ENUM_LABEL_NO_ITEMS,
MENU_SETTING_NO_ITEM, 0, 0, NULL);
#if defined(IOS) || (TARGET_OS_OSX && defined(HAVE_APPLE_STORE))
#if TARGET_OS_IPHONE || (TARGET_OS_OSX && defined(HAVE_APPLE_STORE))
{
struct string_list *sandbox_list = string_list_new();
dir_list_append(sandbox_list, "/private/var", NULL, true, false, false, false);
@@ -677,7 +680,7 @@ static int menu_displaylist_parse_core_info(
settings_t *settings)
{
char tmp[NAME_MAX_LENGTH];
#if IOS
#if TARGET_OS_IPHONE
char shortened_path[NAME_MAX_LENGTH] = {0};
#endif
unsigned i, count = 0;
@@ -927,7 +930,7 @@ static int menu_displaylist_parse_core_info(
_len += strlcpy_lit(tmp + _len, ": ", sizeof(tmp) - _len);
#if IOS
#if TARGET_OS_IPHONE
shortened_path[0] = '\0';
fill_pathname_abbreviate_special(shortened_path,
core_path, sizeof(shortened_path));
@@ -1004,7 +1007,7 @@ static int menu_displaylist_parse_core_info(
/* Show the path that was checked */
{
int _snprintf_ret;
#ifdef IOS
#if TARGET_OS_IPHONE
shortened_path[0] = '\0';
fill_pathname_abbreviate_special(shortened_path,
firmware_info.directory.system,
@@ -1166,7 +1169,7 @@ end:
}
#endif
#if !defined(IOS) || !IOS /* should this be allowed on jailbroken iOS devices? */
#if !TARGET_OS_IPHONE /* should this be allowed on jailbroken iOS devices? */
if (core_path && *core_path)
{
/* Check whether core is currently locked */
@@ -1433,7 +1436,7 @@ static unsigned menu_displaylist_parse_core_manager_list(file_list_t *list,
}
}
#ifndef IOS
#if !TARGET_OS_IPHONE
/* Add 'sideload core' entry */
if (!kiosk_mode_enable)
if (menu_entries_append(list,
@@ -2188,7 +2191,7 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
count++;
}
#ifdef IOS
#if TARGET_OS_IPHONE
{
const char *val_yes_str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_YES);
const char *val_no_str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO);
@@ -4838,7 +4841,7 @@ static unsigned menu_displaylist_parse_cores(menu_handle_t *menu,
}
#endif
#ifdef IOS
#if TARGET_OS_IPHONE
/* For various reasons on iOS/tvOS, MoltenVK shows up
* in the cores directory; exclude it here */
if (string_starts_with(path, "MoltenVK"))
@@ -6735,7 +6738,7 @@ bool menu_displaylist_process(menu_displaylist_info_t *info)
MENU_ENUM_LABEL_CORE_UPDATER_LIST,
MENU_SETTING_ACTION, 0, 0, NULL);
#endif
#ifndef IOS
#if !TARGET_OS_IPHONE
menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_LIST),
MENU_ENUM_LABEL_SIDELOAD_CORE_LIST_STR,
@@ -11098,7 +11101,7 @@ unsigned menu_displaylist_build_list(
{MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_HELP, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_SHOW_WIMP, PARSE_ONLY_UINT, true },
#if !defined(IOS)
#if !TARGET_OS_IPHONE
{MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_RESTART_RETROARCH, PARSE_ONLY_BOOL, true },
#endif
@@ -16148,7 +16151,7 @@ static bool menu_displaylist_ctl_internal(
PARSE_ACTION, false) == 0)
count++;
#if !defined(IOS)
#if !TARGET_OS_IPHONE
if (settings->bools.menu_show_restart_retroarch)
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(
info->list,
+24 -21
View File
@@ -88,6 +88,9 @@
#include "../configuration.h"
#include "../msg_hash.h"
#include "../defaults.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#include "../driver.h"
#include "../paths.h"
#include "../dynamic.h"
@@ -1323,7 +1326,7 @@ static size_t setting_get_string_representation_st_path(rarch_setting_t *setting
const char *path = setting->value.target.string;
if ((setting->type == ST_DIR) && (config_get_ptr()->bools.menu_show_full_paths))
return strlcpy(s, path, len);
#if IOS
#if TARGET_OS_IPHONE
return fill_pathname_abbreviate_special(s,
path_basename(path), len);
#else
@@ -11404,7 +11407,7 @@ static const setting_desc_t mm_desc_6[] = {
#include "../settings/settings_def_menu_main_actions_6.h"
};
#if !defined(IOS) && !defined(HAVE_LAKKA)
#if !TARGET_OS_IPHONE && !defined(HAVE_LAKKA)
static const setting_desc_t mm_desc_7[] = {
/* GENERATED: rows come from settings_def_menu_main_actions_10.h in order. */
#include "../settings/settings_def_menu_main_actions_10.h"
@@ -11416,7 +11419,7 @@ static const setting_desc_t mm_desc_8[] = {
#include "../settings/settings_def_menu_main_lists_2.h"
};
#if !defined(IOS)
#if !TARGET_OS_IPHONE
#ifdef HAVE_LAKKA
static const setting_desc_t quit_lakka_desc[] = {
/* GENERATED: rows come from settings_def_quit_restart.h in order. */
@@ -11425,7 +11428,7 @@ static const setting_desc_t quit_lakka_desc[] = {
#endif
#endif
#if !defined(IOS)
#if !TARGET_OS_IPHONE
#if !defined(HAVE_LAKKA)
static const setting_desc_t mm_desc_9[] = {
/* GENERATED: rows come from settings_def_menu_main_actions_7.h in order. */
@@ -11550,7 +11553,7 @@ static const setting_desc_t metal_argbuf_desc[] = {
};
#endif
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (defined(IOS) && TARGET_OS_TV)
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (TARGET_OS_IPHONE && TARGET_OS_TV)
static const setting_desc_t vid_desc_0[] = {
/* GENERATED: rows come from settings_def_video_suspend_screensaver.h in order. */
#include "../settings/settings_def_video_suspend_screensaver.h"
@@ -12410,7 +12413,7 @@ static const setting_desc_t menu_quit_lakka_desc[] = {
};
#endif
#if !defined(HAVE_LAKKA) && !defined(IOS)
#if !defined(HAVE_LAKKA) && !TARGET_OS_IPHONE
static const setting_desc_t menu_desc_25[] = {
/* GENERATED: rows come from settings_def_quit_visibility.h in order. */
#include "../settings/settings_def_quit_visibility.h"
@@ -12425,7 +12428,7 @@ static const setting_desc_t menu_desc_26[] = {
#endif
#if !(defined(HAVE_LAKKA) || defined(HAVE_ODROIDGO2))
#if !defined(IOS)
#if !TARGET_OS_IPHONE
static const setting_desc_t menu_desc_27[] = {
/* GENERATED: rows come from settings_def_menu_restart_view.h in order. */
#include "../settings/settings_def_menu_restart_view.h"
@@ -12840,7 +12843,7 @@ static const setting_desc_t user_accounts_desc_0_s0[] = {
#endif
#ifdef HAVE_NETWORKING
#if !IOS
#if !TARGET_OS_IPHONE
static const setting_desc_t user_accounts_desc_0_s1[] = {
/* GENERATED: rows come from settings_def_accounts_streaming.h in order. */
#include "../settings/settings_def_accounts_streaming.h"
@@ -13013,7 +13016,7 @@ static void settings_build_main_menu(
ADD_DESC(mm_desc_6);
#if !defined(IOS) && !defined(HAVE_LAKKA)
#if !TARGET_OS_IPHONE && !defined(HAVE_LAKKA)
if (frontend_driver_has_fork())
{
ADD_DESC(mm_desc_7);
@@ -13021,7 +13024,7 @@ static void settings_build_main_menu(
#endif
ADD_DESC(mm_desc_8);
#if !defined(IOS)
#if !TARGET_OS_IPHONE
/* Apple rejects iOS apps that let you forcibly quit them. */
#ifdef HAVE_LAKKA
ADD_DESC(quit_lakka_desc);
@@ -14371,7 +14374,7 @@ static void settings_build_video(
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (defined(IOS) && TARGET_OS_TV)
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (TARGET_OS_IPHONE && TARGET_OS_TV)
ADD_DESC(vid_desc_0);
#endif
END_SUB_GROUP(list, list_info, parent_group);
@@ -15619,14 +15622,14 @@ static void settings_build_menu(
#ifdef HAVE_LAKKA
ADD_DESC(menu_quit_lakka_desc);
#elif !defined(IOS)
#elif !TARGET_OS_IPHONE
ADD_DESC(menu_desc_25);
#endif
#if defined(HAVE_LAKKA) || defined(HAVE_ODROIDGO2)
ADD_DESC(menu_desc_26);
#else
#if !defined(IOS)
#if !TARGET_OS_IPHONE
if (frontend_driver_has_fork())
ADD_DESC(menu_desc_27);
#endif
@@ -16836,7 +16839,7 @@ static void settings_build_user_accounts(
ADD_DESC(user_accounts_desc_0_s0);
#endif
#ifdef HAVE_NETWORKING
#if !IOS
#if !TARGET_OS_IPHONE
ADD_DESC(user_accounts_desc_0_s1);
#endif
#endif
@@ -17761,16 +17764,16 @@ static const settings_desc_table_t settings_desc_registry[] = {
#endif
{ mm_desc_5, (uint16_t)ARRAY_SIZE(mm_desc_5) },
{ mm_desc_6, (uint16_t)ARRAY_SIZE(mm_desc_6) },
#if !defined(IOS) && !defined(HAVE_LAKKA)
#if !TARGET_OS_IPHONE && !defined(HAVE_LAKKA)
{ mm_desc_7, (uint16_t)ARRAY_SIZE(mm_desc_7) },
#endif
{ mm_desc_8, (uint16_t)ARRAY_SIZE(mm_desc_8) },
#if !defined(IOS)
#if !TARGET_OS_IPHONE
#ifdef HAVE_LAKKA
{ quit_lakka_desc, (uint16_t)ARRAY_SIZE(quit_lakka_desc) },
#endif
#endif
#if !defined(IOS)
#if !TARGET_OS_IPHONE
#ifndef HAVE_LAKKA
{ mm_desc_9, (uint16_t)ARRAY_SIZE(mm_desc_9) },
#endif
@@ -17808,7 +17811,7 @@ static const settings_desc_table_t settings_desc_registry[] = {
#if defined(__APPLE__) && defined(HAVE_VULKAN)
{ metal_argbuf_desc, (uint16_t)ARRAY_SIZE(metal_argbuf_desc) },
#endif
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (defined(IOS) && TARGET_OS_TV)
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (TARGET_OS_IPHONE && TARGET_OS_TV)
{ vid_desc_0, (uint16_t)ARRAY_SIZE(vid_desc_0) },
#endif
{ vid_desc_1, (uint16_t)ARRAY_SIZE(vid_desc_1) },
@@ -18082,14 +18085,14 @@ static const settings_desc_table_t settings_desc_registry[] = {
#ifdef HAVE_LAKKA
{ menu_quit_lakka_desc, (uint16_t)ARRAY_SIZE(menu_quit_lakka_desc) },
#endif
#if !defined(HAVE_LAKKA) && !defined(IOS)
#if !defined(HAVE_LAKKA) && !TARGET_OS_IPHONE
{ menu_desc_25, (uint16_t)ARRAY_SIZE(menu_desc_25) },
#endif
#if defined(HAVE_LAKKA) || defined(HAVE_ODROIDGO2)
{ menu_desc_26, (uint16_t)ARRAY_SIZE(menu_desc_26) },
#endif
#if !(defined(HAVE_LAKKA) || defined(HAVE_ODROIDGO2))
#if !defined(IOS)
#if !TARGET_OS_IPHONE
{ menu_desc_27, (uint16_t)ARRAY_SIZE(menu_desc_27) },
#endif
#endif
@@ -18245,7 +18248,7 @@ static const settings_desc_table_t settings_desc_registry[] = {
{ user_accounts_desc_0_s0, (uint16_t)ARRAY_SIZE(user_accounts_desc_0_s0) },
#endif
#ifdef HAVE_NETWORKING
#if !IOS
#if !TARGET_OS_IPHONE
{ user_accounts_desc_0_s1, (uint16_t)ARRAY_SIZE(user_accounts_desc_0_s1) },
#endif
#endif
-1
View File
@@ -129,7 +129,6 @@ OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DHAVE_MINIUPNPC
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DHAVE_ONLINE_UPDATER
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DHAVE_OPENGLES
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DHAVE_OPENGLES3
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DIOS
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DPACKAGE_VERSION=\"$(MARKETING_VERSION)\"
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DRARCH_MOBILE
+9 -6
View File
@@ -41,6 +41,9 @@
#if defined(ANDROID)
#include "play_feature_delivery/play_feature_delivery.h"
#include <compat/strl.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#ifndef PLAYLIST_ENTRIES
@@ -177,7 +180,7 @@ size_t playlist_config_set_base_content_directory(
{
config->autofix_paths = path && *path;
if (config->autofix_paths)
#if IOS
#if TARGET_OS_IPHONE
return fill_pathname_abbreviate_special(
config->base_content_directory, path,
sizeof(config->base_content_directory));
@@ -1470,7 +1473,7 @@ void playlist_resolve_path(enum playlist_file_mode mode,
{
bool resolve_symlinks = true;
#if IOS
#if TARGET_OS_IPHONE
char tmp[PATH_MAX_LENGTH];
fill_pathname_expand_special(tmp, s, sizeof(tmp));
@@ -1521,13 +1524,13 @@ void playlist_resolve_path(enum playlist_file_mode mode,
**/
bool playlist_content_path_is_valid(const char *path)
{
#ifdef IOS
#if TARGET_OS_IPHONE
char expanded_path[PATH_MAX_LENGTH];
#endif
/* Sanity check */
if (!path || !*path)
return false;
#ifdef IOS
#if TARGET_OS_IPHONE
fill_pathname_expand_special(expanded_path, path, sizeof(expanded_path));
path = expanded_path;
#endif
@@ -4586,7 +4589,7 @@ void playlist_set_scan_content_dir(playlist_t *playlist, const char *content_dir
{
bool current_string_empty;
bool new_string_empty;
#if IOS
#if TARGET_OS_IPHONE
char _tmpbuf[PATH_MAX_LENGTH];
fill_pathname_abbreviate_special(_tmpbuf, content_dir, sizeof(_tmpbuf));
content_dir = _tmpbuf;
@@ -4653,7 +4656,7 @@ void playlist_set_scan_dat_file_path(playlist_t *playlist, const char *dat_file_
{
bool current_string_empty;
bool new_string_empty;
#if IOS
#if TARGET_OS_IPHONE
char _tmpbuf[PATH_MAX_LENGTH];
fill_pathname_abbreviate_special(_tmpbuf, dat_file_path, sizeof(_tmpbuf));
dat_file_path = _tmpbuf;
+4 -1
View File
@@ -88,6 +88,9 @@
#include <file/file_path.h>
#include <retro_miscellaneous.h>
#include <lists/dir_list.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifdef __EMSCRIPTEN__
#include <emscripten/emscripten.h>
@@ -7387,7 +7390,7 @@ static void retroarch_parse_input_libretro_path(
/* Check if path is a directory */
if (
((path_stats & RETRO_VFS_STAT_IS_DIRECTORY) != 0)
#if defined(IOS) || TARGET_OS_OSX
#if TARGET_OS_IPHONE || TARGET_OS_OSX
&& !string_ends_with(path, ".framework")
#endif
)
+3
View File
@@ -86,6 +86,9 @@
#include <retro_miscellaneous.h>
#include <queues/message_queue.h>
#include <lists/dir_list.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#ifdef __EMSCRIPTEN__
#include "frontend/drivers/platform_emscripten.h"
+8 -8
View File
@@ -4,30 +4,30 @@
* matches SDESC_<kind>_ROW; row order is menu display order;
* h2json.py parses these rows for the Crowdin source upload. */
/* Descriptor and configuration rows are #ifdef HAVE_NETWORKING #if !IOS; the string
/* Descriptor and configuration rows are #ifdef HAVE_NETWORKING #if !TARGET_OS_IPHONE; the string
* tables always carry this row via the strings pass. */
#if defined(HAVE_NETWORKING) && !IOS || defined(SETTINGS_DEF_STRINGS_PASS)
#if defined(HAVE_NETWORKING) && !TARGET_OS_IPHONE || defined(SETTINGS_DEF_STRINGS_PASS)
S_ACTION_NS(ACCOUNTS_YOUTUBE,
"youtube",
"YouTube")
#endif
/* Descriptor and configuration rows are #ifdef HAVE_NETWORKING #if !IOS; the string
/* Descriptor and configuration rows are #ifdef HAVE_NETWORKING #if !TARGET_OS_IPHONE; the string
* tables always carry this row via the strings pass. */
#if defined(HAVE_NETWORKING) && !IOS || defined(SETTINGS_DEF_STRINGS_PASS)
#if defined(HAVE_NETWORKING) && !TARGET_OS_IPHONE || defined(SETTINGS_DEF_STRINGS_PASS)
S_ACTION_NS(ACCOUNTS_TWITCH,
"twitch",
"Twitch")
#endif
/* Descriptor and configuration rows are #ifdef HAVE_NETWORKING #if !IOS; the string
/* Descriptor and configuration rows are #ifdef HAVE_NETWORKING #if !TARGET_OS_IPHONE; the string
* tables always carry this row via the strings pass. */
#if defined(HAVE_NETWORKING) && !IOS || defined(SETTINGS_DEF_STRINGS_PASS)
#if defined(HAVE_NETWORKING) && !TARGET_OS_IPHONE || defined(SETTINGS_DEF_STRINGS_PASS)
S_ACTION_NS(ACCOUNTS_FACEBOOK,
"facebook",
"Facebook Gaming")
#endif
/* Descriptor and configuration rows are #ifdef HAVE_NETWORKING #if !IOS; the string
/* Descriptor and configuration rows are #ifdef HAVE_NETWORKING #if !TARGET_OS_IPHONE; the string
* tables always carry this row via the strings pass. */
#if defined(HAVE_NETWORKING) && !IOS || defined(SETTINGS_DEF_STRINGS_PASS)
#if defined(HAVE_NETWORKING) && !TARGET_OS_IPHONE || defined(SETTINGS_DEF_STRINGS_PASS)
S_ACTION_NS(ACCOUNTS_KICK,
"kick",
"Kick")
+2 -2
View File
@@ -4,9 +4,9 @@
* matches SDESC_<kind>_ROW; row order is menu display order;
* h2json.py parses these rows for the Crowdin source upload. */
/* Descriptor and configuration rows are #if !defined(IOS) && !defined(HAVE_LAKKA); the string
/* Descriptor and configuration rows are #if !TARGET_OS_IPHONE && !defined(HAVE_LAKKA); the string
* tables always carry this row via the strings pass. */
#if (!defined(IOS) && !defined(HAVE_LAKKA)) || defined(SETTINGS_DEF_STRINGS_PASS)
#if (!TARGET_OS_IPHONE && !defined(HAVE_LAKKA)) || defined(SETTINGS_DEF_STRINGS_PASS)
S_ACTION_EX(RESTART_RETROARCH,
"restart_retroarch", SD_FLAG_NONE, NULL, NULL, CMD_EVENT_RESTART_RETROARCH,
"Restart",
+5 -2
View File
@@ -9,14 +9,17 @@
#ifndef SETTINGS_DEF_ENUM_PASS
#ifndef S_ACTION_H
#define S_ACTION_H S_ACTION
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#ifndef S_ACTION_EX_H
#define S_ACTION_EX_H S_ACTION_EX
#endif
#endif
/* Descriptor and configuration rows are #if !defined(IOS) #if !defined(HAVE_LAKKA); the string
/* Descriptor and configuration rows are #if !TARGET_OS_IPHONE #if !defined(HAVE_LAKKA); the string
* tables always carry this row via the strings pass. */
#if !defined(IOS) && !defined(HAVE_LAKKA) || defined(SETTINGS_DEF_STRINGS_PASS)
#if !TARGET_OS_IPHONE && !defined(HAVE_LAKKA) || defined(SETTINGS_DEF_STRINGS_PASS)
S_ACTION_EX_H(QUIT_RETROARCH,
"quit_retroarch",
SD_FLAG_NONE, NULL, NULL, CMD_EVENT_QUIT,
+2 -2
View File
@@ -4,9 +4,9 @@
* matches SDESC_<kind>_ROW; row order is menu display order;
* h2json.py parses these rows for the Crowdin source upload. */
/* Descriptor and configuration rows are #if !(defined(HAVE_LAKKA) || defined(HAVE_ODROIDGO2)) #if !defined(IOS); the string
/* Descriptor and configuration rows are #if !(defined(HAVE_LAKKA) || defined(HAVE_ODROIDGO2)) #if !TARGET_OS_IPHONE; the string
* tables always carry this row via the strings pass. */
#if (!(defined(HAVE_LAKKA) || defined(HAVE_ODROIDGO2))) && !defined(IOS) || defined(SETTINGS_DEF_STRINGS_PASS)
#if (!(defined(HAVE_LAKKA) || defined(HAVE_ODROIDGO2))) && !TARGET_OS_IPHONE || defined(SETTINGS_DEF_STRINGS_PASS)
S_BOOL(menu_show_restart_retroarch, MENU_SHOW_RESTART_RETROARCH,
"menu_show_restart_retroarch",
DEFAULT_MENU_SHOW_RESTART, SD_FLAG_NONE, 0, 0,
@@ -9,11 +9,14 @@
#ifndef SETTINGS_DEF_ENUM_PASS
#ifndef S_BOOL_H
#define S_BOOL_H S_BOOL
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
/* Descriptor and configuration rows are #if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (defined(IOS) && TARGET_OS_TV); the string
#endif
/* Descriptor and configuration rows are #if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (TARGET_OS_IPHONE && TARGET_OS_TV); the string
* tables always carry this row via the strings pass. */
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (defined(IOS) && TARGET_OS_TV) || defined(SETTINGS_DEF_STRINGS_PASS) || defined(SETTINGS_DEF_CONFIG_PASS)
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (TARGET_OS_IPHONE && TARGET_OS_TV) || defined(SETTINGS_DEF_STRINGS_PASS) || defined(SETTINGS_DEF_CONFIG_PASS)
S_BOOL_H(ui_suspend_screensaver_enable, SUSPEND_SCREENSAVER_ENABLE,
"suspend_screensaver_enable",
true, SD_FLAG_LAKKA_ADVANCED, 0, 0,
+4 -1
View File
@@ -48,6 +48,9 @@
#ifdef HAVE_NETWORKING
#include "../network/netplay/netplay.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
enum
{
@@ -546,7 +549,7 @@ static void task_netplay_crc_scan_callback(retro_task_t *task,
{
const char *content_path = (state->state & STATE_RELOAD) ?
data->current.content_path : data->content_paths.elems[0].data;
#if IOS
#if TARGET_OS_IPHONE
char tmp[PATH_MAX_LENGTH];
fill_pathname_expand_special(tmp, content_path, sizeof(tmp));
content_path = tmp;
+3
View File
@@ -5,6 +5,9 @@ extern bool RAIsVoiceOverRunning(void);
#if TARGET_OS_TV
#include "config_file.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
extern config_file_t *open_userdefaults_config_file(void);
extern void write_userdefaults_config_file(void);
extern void update_topshelf(void);
+3
View File
@@ -59,6 +59,9 @@
#endif
#include "../../../retroarch.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#if TARGET_OS_IPHONE && defined(HAVE_COCOATOUCH)
#define RAScreen UIScreen
+6 -3
View File
@@ -69,9 +69,12 @@
#ifdef HAVE_MIST
#include "../../steam/steam.h"
#include <compat/strl.h>
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#if IOS
#if TARGET_OS_IPHONE
#import <UIKit/UIAccessibility.h>
extern bool RAIsVoiceOverRunning(void)
{
@@ -197,7 +200,7 @@ void rarch_stop_draw_observer(void)
#if !TARGET_OS_OSX || __MAC_OS_X_VERSION_MAX_ALLOWED >= 140000
-(void)step:(CADisplayLink*)target API_AVAILABLE(macos(14.0), ios(3.1), tvos(3.1))
{
#if defined(IOS)
#if TARGET_OS_IPHONE
if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateActive)
return;
@@ -248,7 +251,7 @@ void rarch_stop_draw_observer(void)
view = [CocoaView new];
RARCH_AUTORELEASE(view);
nsview_set_ptr(view);
#if defined(IOS)
#if TARGET_OS_IPHONE
view.displayLink = [CADisplayLink displayLinkWithTarget:view selector:@selector(step:)];
{
float hz = (float)[UIScreen mainScreen].maximumFramesPerSecond;
+3
View File
@@ -67,6 +67,9 @@
#ifdef HAVE_NETWORKING
#include "../../network/netplay/netplay_private.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
#endif
#import <AVFoundation/AVFoundation.h>
+4 -1
View File
@@ -24,6 +24,9 @@
#include "../verbosity.h"
#include "ui_companion_driver.h"
#ifdef __MACH__
#include <TargetConditionals.h>
#endif
static ui_companion_driver_t ui_companion_null = {
NULL, /* init */
@@ -53,7 +56,7 @@ static const ui_companion_driver_t *ui_companion_drivers[] = {
#if TARGET_OS_OSX
&ui_companion_cocoa,
#endif
#if defined(IOS)
#if TARGET_OS_IPHONE
&ui_companion_cocoatouch,
#endif
&ui_companion_null,