cocoabits / MASShortcut

Modern framework for managing global keyboard shortcuts compatible with Mac App Store. More details:
http://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-cocoa.html
BSD 2-Clause "Simplified" License
1.52k stars 220 forks source link

Silence deprecation warnings when building for Sierra #99

Closed zoul closed 8 years ago

zoul commented 8 years ago

See #98 for the rationale.

zoul commented 8 years ago

Long story short: NSControlKeyMask and friends were replaced with NSEventModifierFlagControl and similar in macOS Sierra. The project builds fine & clean, but including MASShortcut in a project with deployment target set to 10.12 results in several deprecation warnings because of the control masks. Simply replacing the old symbols with the new ones isn’t an option, since it breaks the build on older SDKs – in Travis, for example.

zoul commented 8 years ago

Here’s a similar scenario, they simply define the new symbols on older SDKs. I think that’s an acceptable approach if we get the SDK version check right. We could then delete the defines later, when 10.12 is the standard SDK everywhere.

zoul commented 8 years ago

OK, after a few fumbles I think I got the conditional defines right. @clemens-schulz, can you please verify that the current HEAD builds cleanly in your 10.12 project? After that I can make a release.

clemens-schulz commented 8 years ago

Current HEAD builds cleanly. 👍 Thank you for fixing it!

zoul commented 8 years ago

Great, happy to help. Now available in the 2.3.6 release.