fix(macOS): Use correct availability macro check

This commit is contained in:
Stuart Carnie 2018-07-04 14:19:05 -07:00
parent 95500f5631
commit d8061ac0e9
3 changed files with 27 additions and 27 deletions

View File

@ -23,8 +23,8 @@
#include "cocoa_common.h" #include "cocoa_common.h"
#include "../../ui_companion_driver.h" #include "../../ui_companion_driver.h"
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
static const NSEventMask NSEventMaskAny = NSAnyEventMask; #define NSEventMaskAny NSAnyEventMask
#endif #endif
static void* ui_application_cocoa_initialize(void) static void* ui_application_cocoa_initialize(void)

View File

@ -25,10 +25,10 @@
#include "../../ui_companion_driver.h" #include "../../ui_companion_driver.h"
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
static const NSAlertStyle NSAlertStyleCritical = NSCriticalAlertStyle; #define NSAlertStyleCritical NSCriticalAlertStyle
static const NSAlertStyle NSAlertStyleWarning = NSWarningAlertStyle; #define NSAlertStyleWarning NSWarningAlertStyle
static const NSAlertStyle NSAlertStyleInformational = NSInformationalAlertStyle; #define NSAlertStyleInformational NSInformationalAlertStyle
#endif #endif
static enum ui_msg_window_response ui_msg_window_cocoa_dialog(ui_msg_window_state *state, enum ui_msg_window_type type) static enum ui_msg_window_response ui_msg_window_cocoa_dialog(ui_msg_window_state *state, enum ui_msg_window_type type)

View File

@ -71,29 +71,29 @@ static void app_terminate(void)
@implementation RApplication @implementation RApplication
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
static const NSEventType NSEventTypeKeyDown = NSKeyDown; #define NSEventTypeKeyDown NSKeyDown
static const NSEventType NSEventTypeKeyUp = NSKeyUp; #define NSEventTypeKeyUp NSKeyUp
static const NSEventType NSEventTypeFlagsChanged = NSFlagsChanged; #define NSEventTypeFlagsChanged NSFlagsChanged
static const NSEventType NSEventTypeMouseMoved = NSMouseMoved; #define NSEventTypeMouseMoved NSMouseMoved
static const NSEventType NSEventTypeLeftMouseDragged = NSLeftMouseDragged; #define NSEventTypeLeftMouseDragged NSLeftMouseDragged
static const NSEventType NSEventTypeRightMouseDragged = NSRightMouseDragged; #define NSEventTypeRightMouseDragged NSRightMouseDragged
static const NSEventType NSEventTypeOtherMouseDragged = NSOtherMouseDragged; #define NSEventTypeOtherMouseDragged NSOtherMouseDragged
static const NSEventType NSEventTypeLeftMouseDown = NSLeftMouseDown; #define NSEventTypeLeftMouseDown NSLeftMouseDown
static const NSEventType NSEventTypeRightMouseDown = NSRightMouseDown; #define NSEventTypeRightMouseDown NSRightMouseDown
static const NSEventType NSEventTypeOtherMouseDown = NSOtherMouseDown; #define NSEventTypeOtherMouseDown NSOtherMouseDown
static const NSEventType NSEventTypeLeftMouseUp = NSLeftMouseUp; #define NSEventTypeLeftMouseUp NSLeftMouseUp
static const NSEventType NSEventTypeRightMouseUp = NSRightMouseUp; #define NSEventTypeRightMouseUp NSRightMouseUp
static const NSEventType NSEventTypeOtherMouseUp = NSOtherMouseUp; #define NSEventTypeOtherMouseUp NSOtherMouseUp
static const NSEventType NSEventTypeScrollWheel = NSScrollWheel; #define NSEventTypeScrollWheel NSScrollWheel
// modifier flags // modifier flags
static const NSEventModifierFlags NSEventModifierFlagCapsLock = NSAlphaShiftKeyMask; #define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask
static const NSEventModifierFlags NSEventModifierFlagShift = NSShiftKeyMask; #define NSEventModifierFlagShift NSShiftKeyMask
static const NSEventModifierFlags NSEventModifierFlagControl = NSControlKeyMask; #define NSEventModifierFlagControl NSControlKeyMask
static const NSEventModifierFlags NSEventModifierFlagOption = NSAlternateKeyMask; #define NSEventModifierFlagOption NSAlternateKeyMask
static const NSEventModifierFlags NSEventModifierFlagCommand = NSCommandKeyMask; #define NSEventModifierFlagCommand NSCommandKeyMask
static const NSEventModifierFlags NSEventModifierFlagNumericPad= NSNumericPadKeyMask; #define NSEventModifierFlagNumericPad NSNumericPadKeyMask
#endif #endif
- (void)sendEvent:(NSEvent *)event - (void)sendEvent:(NSEvent *)event