Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae316b4

Browse files
committed
Define aliases if we are compiling on older SDKs
1 parent 42271f5 commit ae316b4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/_macosx.m

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,40 @@
1818
#define COMPILING_FOR_10_10
1919
#endif
2020

21+
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
22+
/* A lot of symbols were renamed in Sierra and cause deprecation warnings
23+
so define macros for the new names if we are compiling on an older SDK */
24+
#define NSEventMaskAny NSAnyEventMask
25+
#define NSEventTypeApplicationDefined NSApplicationDefined
26+
#define NSEventModifierFlagCommand NSCommandKeyMask
27+
#define NSEventModifierFlagControl NSControlKeyMask
28+
#define NSEventModifierFlagOption NSAlternateKeyMask
29+
#define NSEventModifierFlagShift NSShiftKeyMask
30+
#define NSEventTypeKeyUp NSKeyUp
31+
#define NSEventTypeKeyDown NSKeyDown
32+
#define NSEventTypeMouseMoved NSMouseMoved
33+
#define NSEventTypeLeftMouseDown NSLeftMouseDown
34+
#define NSEventTypeRightMouseDown NSRightMouseDown
35+
#define NSEventTypeOtherMouseDown NSOtherMouseDown
36+
#define NSEventTypeLeftMouseDragged NSLeftMouseDragged
37+
#define NSEventTypeRightMouseDragged NSRightMouseDragged
38+
#define NSEventTypeOtherMouseDragged NSOtherMouseDragged
39+
#define NSEventTypeLeftMouseUp NSLeftMouseUp
40+
#define NSEventTypeRightMouseUp NSRightMouseUp
41+
#define NSEventTypeOtherMouseUp NSOtherMouseUp
42+
#define NSWindowStyleMaskClosable NSClosableWindowMask
43+
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
44+
#define NSWindowStyleMaskResizable NSResizableWindowMask
45+
#define NSWindowStyleMaskTitled NSTitledWindowMask
46+
#endif
47+
48+
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101400
49+
/* A few more deprecations in Mojave */
50+
#define NSButtonTypeMomentaryLight NSMomentaryLightButton
51+
#define NSButtonTypePushOnPushOff NSPushOnPushOffButton
52+
#define NSBezelStyleShadowlessSquare NSShadowlessSquareBezelStyle
53+
#define CGContext graphicsPort
54+
#endif
2155

2256
/* CGFloat was defined in Mac OS X 10.5 */
2357
#ifndef CGFLOAT_DEFINED

0 commit comments

Comments
 (0)