commit | 072991165226c11c888c881218850e8318c2b32e | [log] [tgz] |
---|---|---|
author | tomheng <zhm20070928@gmail.com> | Sun Oct 23 14:49:24 2016 +0800 |
committer | Brad Fitzpatrick <bradfitz@golang.org> | Sat Dec 09 01:20:58 2017 +0000 |
tree | 9a5328e45a322c3a197d961c40d82e960eb7f66f | |
parent | a05f2c1e93dc0743a12c519ef35f386b8c095d91 [diff] |
shiny/driver: use __MAC_OS_X_VERSION_MAX_ALLOWED for conditional compilation __MAC_OS_X_VERSION_MAX_ALLOWED is official way to do conditional compilation according to documentation in: https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-SW5 Fixes golang/go#22634 Change-Id: I916403149ed6a1ede5d8dcb554d152784c302fcb Reviewed-on: https://go-review.googlesource.com/31546 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/shiny/driver/gldriver/cocoa.m b/shiny/driver/gldriver/cocoa.m index 1e96e3f..d8bfb8c 100644 --- a/shiny/driver/gldriver/cocoa.m +++ b/shiny/driver/gldriver/cocoa.m
@@ -14,17 +14,16 @@ #import <Foundation/Foundation.h> #import <OpenGL/gl3.h> -#define IS_MAC_SIERRA_OR_LATER (NSAppKitVersionNumber - NSAppKitVersionNumber10_11) - // The variables did not exist on older OS X releases, // we use the old variables deprecated on macOS to define them. -#if !IS_MAC_SIERRA_OR_LATER +#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200 enum { NSEventTypeScrollWheel = NSScrollWheel, NSEventTypeKeyDown = NSKeyDown }; -enum { +enum +{ NSWindowStyleMaskTitled = NSTitledWindowMask, NSWindowStyleMaskResizable = NSResizableWindowMask, NSWindowStyleMaskMiniaturizable = NSMiniaturizableWindowMask,