Skip to content

Commit 6c37fb0

Browse files
committed
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.
1 parent d38dcb5 commit 6c37fb0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ui/drivers/ui_cocoa.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,13 @@ int main(int argc, char *argv[])
14471447
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
14481448
#endif
14491449
[NSApplication sharedApplication];
1450+
#ifdef MAC_OS_X_VERSION_10_6
1451+
/* setActivationPolicy: and NSApplicationActivationPolicyRegular
1452+
* are 10.6+. Before that, an app becomes a regular GUI app
1453+
* via Info.plist (CFBundlePackageType=APPL, no LSUIElement
1454+
* / LSBackgroundOnly), which the PPC bundle already does. */
14501455
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
1456+
#endif
14511457

14521458
delegate = [[RetroArch_OSX alloc] init];
14531459
window = cocoa_create_main_window();

0 commit comments

Comments
 (0)