ui_cocoa: gate setActivationPolicy: on 10.6+ SDK

GCC 4.0 (Xcode 3.1, PowerPC) reports:

    ui_cocoa.m:1450: error: 'NSApplicationActivationPolicyRegular'
        undeclared (first use in this function)

NSApplication's setActivationPolicy: method and the matching
NSApplicationActivationPolicy* enum were introduced in 10.6 Snow
Leopard.  On the 10.5 SDK neither exists.

Before 10.6, apps declared themselves as regular GUI apps through
Info.plist (CFBundlePackageType=APPL, absence of LSUIElement and
LSBackgroundOnly).  The PPC bundle already has this, so skipping
the runtime call is effectively a no-op on Leopard/Tiger.

Wrap the call in #ifdef MAC_OS_X_VERSION_10_6 — a gate pattern the
file already uses at lines 169 and 618.  Modern builds are
unaffected.
This commit is contained in:
U-DESKTOP-SPFP6AQ\twistedtechre committed 2026-04-21 02:06:05 +02:00
1 parent d38dcb543f
commit 6c37fb0da1
1 file changed
+6
+6
View File
@@ -1447,7 +1447,13 @@ int main(int argc, char *argv[])
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
#endif
[NSApplication sharedApplication];
#ifdef MAC_OS_X_VERSION_10_6
/* setActivationPolicy: and NSApplicationActivationPolicyRegular
* are 10.6+. Before that, an app becomes a regular GUI app
* via Info.plist (CFBundlePackageType=APPL, no LSUIElement
* / LSBackgroundOnly), which the PPC bundle already does. */
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
#endif
delegate = [[RetroArch_OSX alloc] init];
window = cocoa_create_main_window();