Skip to content

Commit

Permalink
Merge pull request #92 from gearboxworks/osx-mojave-fix
Browse files Browse the repository at this point in the history
Attempt to fix #75
  • Loading branch information
joesis authored Jun 26, 2019
2 parents 3d7db9f + 0a29fdd commit f2fa635
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions systray_darwin.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#import <Cocoa/Cocoa.h>
#include "systray.h"

#ifndef NSControlStateValueOff
#define NSControlStateValueOff NSOffState
#endif
#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_14

#ifndef NSControlStateValueOff
#define NSControlStateValueOff NSOffState
#endif

#ifndef NSControlStateValueOn
#define NSControlStateValueOn NSOnState
#endif

#ifndef NSControlStateValueOn
#define NSControlStateValueOn NSOnState
#endif

@interface MenuItem : NSObject
Expand Down

3 comments on commit f2fa635

@reedwade
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, curious how important the OS version check here is. If I remove this then I can get it to compile on MacOS v10.12 -- otherwise not

systray_darwin.m:132:22: error: use of undeclared identifier 'NSControlStateValueOn'
systray_darwin.m:134:22: error: use of undeclared identifier 'NSControlStateValueOff'

-- and I'm having trouble figuring out how to pass __MAC_OS_X_VERSION_MIN_REQUIRED in usefully.

@joesis
Copy link
Contributor Author

@joesis joesis commented on f2fa635 Jul 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. So __MAC_OS_X_VERSION_MIN_REQUIRED is not defined in your case? What's your building environment? Some one familiar with macOS developing may know better, but to be safe, maybe change it to something like this?

if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_14

@reedwade
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally got around to testing on a collection of machines and the above didn't go but the recent update which uses #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400 is working for me on 10.12 and 10.14 sdks. yay!

Please sign in to comment.