Revert "Use constant values instead of MAC_OS_X_VERSION_ - might not be available on earlier OSX versions/xcode"

This reverts commit f35b578c42c6a1cd6b96ec87c4b50a97e0cb9b83.
This commit is contained in:
twinaphex 2018-08-31 19:19:56 +02:00
parent 1265d7546c
commit 0b069c4ee3
2 changed files with 9 additions and 13 deletions

View File

@ -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 >= 1090
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
[alert beginSheetModalForWindow:(BRIDGE NSWindow *)ui_companion_driver_get_main_window()
completionHandler:^(NSModalResponse returnCode) {
[[NSApplication sharedApplication] stopModalWithCode:returnCode];

View File

@ -42,10 +42,6 @@
#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
@ -78,7 +74,7 @@ id<ApplePlatform> apple_platform;
apple_view_type_t _vt;
NSView* _renderView;
id _sleepActivity;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
WindowListener *_listener;
#endif
}
@ -259,7 +255,7 @@ static char** waiting_argv;
{
unsigned i;
apple_platform = self;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
self.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenPrimary;
#else
SEL selector = NSSelectorFromString(BOXSTRING("setCollectionBehavior:"));
@ -272,12 +268,12 @@ static char** waiting_argv;
}
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
_listener = [WindowListener new];
#endif
[self.window setAcceptsMouseMovedEvents: YES];
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
[self.window setNextResponder:_listener];
self.window.delegate = _listener;
#endif
@ -298,7 +294,7 @@ static char** waiting_argv;
waiting_argc = 0;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
[self.window makeMainWindow];
[self.window makeKeyWindow];
#endif
@ -319,7 +315,7 @@ static char** waiting_argv;
_renderView.wantsLayer = NO;
_renderView.layer = nil;
[_renderView removeFromSuperview];
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
self.window.contentView = nil;
#endif
_renderView = nil;
@ -352,7 +348,7 @@ static char** waiting_argv;
_renderView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
_renderView.frame = self.window.contentView.bounds;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
self.window.contentView = _renderView;
[self.window.contentView setNextResponder:_listener];
#else
@ -403,7 +399,7 @@ static char** waiting_argv;
- (bool)setDisableDisplaySleep:(bool)disable
{
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
if (disable && _sleepActivity == nil)
{
_sleepActivity = [NSProcessInfo.processInfo beginActivityWithOptions:NSActivityIdleDisplaySleepDisabled reason:@"disable screen saver"];