diff --git a/ui/drivers/cocoa/ui_cocoa_application.m b/ui/drivers/cocoa/ui_cocoa_application.m index 1f51257476..54ecf46ef1 100644 --- a/ui/drivers/cocoa/ui_cocoa_application.m +++ b/ui/drivers/cocoa/ui_cocoa_application.m @@ -23,8 +23,8 @@ #include "cocoa_common.h" #include "../../ui_companion_driver.h" -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 -static const NSEventMask NSEventMaskAny = NSAnyEventMask; +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 +#define NSEventMaskAny NSAnyEventMask #endif static void* ui_application_cocoa_initialize(void) diff --git a/ui/drivers/cocoa/ui_cocoa_msg_window.m b/ui/drivers/cocoa/ui_cocoa_msg_window.m index b166c693d7..d85bc8e99e 100644 --- a/ui/drivers/cocoa/ui_cocoa_msg_window.m +++ b/ui/drivers/cocoa/ui_cocoa_msg_window.m @@ -25,10 +25,10 @@ #include "../../ui_companion_driver.h" -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 -static const NSAlertStyle NSAlertStyleCritical = NSCriticalAlertStyle; -static const NSAlertStyle NSAlertStyleWarning = NSWarningAlertStyle; -static const NSAlertStyle NSAlertStyleInformational = NSInformationalAlertStyle; +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 +#define NSAlertStyleCritical NSCriticalAlertStyle +#define NSAlertStyleWarning NSWarningAlertStyle +#define NSAlertStyleInformational NSInformationalAlertStyle #endif static enum ui_msg_window_response ui_msg_window_cocoa_dialog(ui_msg_window_state *state, enum ui_msg_window_type type) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 4070cfe873..c318af6e0a 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -71,29 +71,29 @@ static void app_terminate(void) @implementation RApplication -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 -static const NSEventType NSEventTypeKeyDown = NSKeyDown; -static const NSEventType NSEventTypeKeyUp = NSKeyUp; -static const NSEventType NSEventTypeFlagsChanged = NSFlagsChanged; -static const NSEventType NSEventTypeMouseMoved = NSMouseMoved; -static const NSEventType NSEventTypeLeftMouseDragged = NSLeftMouseDragged; -static const NSEventType NSEventTypeRightMouseDragged = NSRightMouseDragged; -static const NSEventType NSEventTypeOtherMouseDragged = NSOtherMouseDragged; -static const NSEventType NSEventTypeLeftMouseDown = NSLeftMouseDown; -static const NSEventType NSEventTypeRightMouseDown = NSRightMouseDown; -static const NSEventType NSEventTypeOtherMouseDown = NSOtherMouseDown; -static const NSEventType NSEventTypeLeftMouseUp = NSLeftMouseUp; -static const NSEventType NSEventTypeRightMouseUp = NSRightMouseUp; -static const NSEventType NSEventTypeOtherMouseUp = NSOtherMouseUp; -static const NSEventType NSEventTypeScrollWheel = NSScrollWheel; +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 +#define NSEventTypeKeyDown NSKeyDown +#define NSEventTypeKeyUp NSKeyUp +#define NSEventTypeFlagsChanged NSFlagsChanged +#define NSEventTypeMouseMoved NSMouseMoved +#define NSEventTypeLeftMouseDragged NSLeftMouseDragged +#define NSEventTypeRightMouseDragged NSRightMouseDragged +#define NSEventTypeOtherMouseDragged NSOtherMouseDragged +#define NSEventTypeLeftMouseDown NSLeftMouseDown +#define NSEventTypeRightMouseDown NSRightMouseDown +#define NSEventTypeOtherMouseDown NSOtherMouseDown +#define NSEventTypeLeftMouseUp NSLeftMouseUp +#define NSEventTypeRightMouseUp NSRightMouseUp +#define NSEventTypeOtherMouseUp NSOtherMouseUp +#define NSEventTypeScrollWheel NSScrollWheel // modifier flags -static const NSEventModifierFlags NSEventModifierFlagCapsLock = NSAlphaShiftKeyMask; -static const NSEventModifierFlags NSEventModifierFlagShift = NSShiftKeyMask; -static const NSEventModifierFlags NSEventModifierFlagControl = NSControlKeyMask; -static const NSEventModifierFlags NSEventModifierFlagOption = NSAlternateKeyMask; -static const NSEventModifierFlags NSEventModifierFlagCommand = NSCommandKeyMask; -static const NSEventModifierFlags NSEventModifierFlagNumericPad= NSNumericPadKeyMask; +#define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask +#define NSEventModifierFlagShift NSShiftKeyMask +#define NSEventModifierFlagControl NSControlKeyMask +#define NSEventModifierFlagOption NSAlternateKeyMask +#define NSEventModifierFlagCommand NSCommandKeyMask +#define NSEventModifierFlagNumericPad NSNumericPadKeyMask #endif - (void)sendEvent:(NSEvent *)event