mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Use constant values instead of MAC_OS_X_VERSION_ - might not be available on earlier OSX versions/xcode
This commit is contained in:
parent
1222192afb
commit
f35b578c42
@ -80,7 +80,7 @@ static enum ui_msg_window_response ui_msg_window_cocoa_dialog(ui_msg_window_stat
|
||||
break;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
|
||||
[alert beginSheetModalForWindow:(BRIDGE NSWindow *)ui_companion_driver_get_main_window()
|
||||
completionHandler:^(NSModalResponse returnCode) {
|
||||
[[NSApplication sharedApplication] stopModalWithCode:returnCode];
|
||||
|
@ -42,6 +42,10 @@
|
||||
#import <MetalKit/MetalKit.h>
|
||||
#endif
|
||||
|
||||
#ifndef MAC_OS_X_VERSION_10_6
|
||||
#define MAC_OS_X_VERSION_10_6 1060
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
||||
@interface WindowListener : NSResponder<NSWindowDelegate>
|
||||
@end
|
||||
@ -74,7 +78,7 @@ id<ApplePlatform> apple_platform;
|
||||
apple_view_type_t _vt;
|
||||
NSView* _renderView;
|
||||
id _sleepActivity;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
WindowListener *_listener;
|
||||
#endif
|
||||
}
|
||||
@ -255,7 +259,7 @@ static char** waiting_argv;
|
||||
{
|
||||
unsigned i;
|
||||
apple_platform = self;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
self.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenPrimary;
|
||||
#else
|
||||
SEL selector = NSSelectorFromString(BOXSTRING("setCollectionBehavior:"));
|
||||
@ -268,12 +272,12 @@ static char** waiting_argv;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
_listener = [WindowListener new];
|
||||
#endif
|
||||
|
||||
[self.window setAcceptsMouseMovedEvents: YES];
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
[self.window setNextResponder:_listener];
|
||||
self.window.delegate = _listener;
|
||||
#endif
|
||||
@ -294,7 +298,7 @@ static char** waiting_argv;
|
||||
|
||||
waiting_argc = 0;
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
[self.window makeMainWindow];
|
||||
[self.window makeKeyWindow];
|
||||
#endif
|
||||
@ -315,7 +319,7 @@ static char** waiting_argv;
|
||||
_renderView.wantsLayer = NO;
|
||||
_renderView.layer = nil;
|
||||
[_renderView removeFromSuperview];
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
self.window.contentView = nil;
|
||||
#endif
|
||||
_renderView = nil;
|
||||
@ -348,7 +352,7 @@ static char** waiting_argv;
|
||||
_renderView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
||||
_renderView.frame = self.window.contentView.bounds;
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
self.window.contentView = _renderView;
|
||||
[self.window.contentView setNextResponder:_listener];
|
||||
#else
|
||||
@ -399,7 +403,7 @@ static char** waiting_argv;
|
||||
|
||||
- (bool)setDisableDisplaySleep:(bool)disable
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
|
||||
if (disable && _sleepActivity == nil)
|
||||
{
|
||||
_sleepActivity = [NSProcessInfo.processInfo beginActivityWithOptions:NSActivityIdleDisplaySleepDisabled reason:@"disable screen saver"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user