Skip to content

Commit

Permalink
macx/compat: fix build of compat.m shim with Sierra SDK.
Browse files Browse the repository at this point in the history
The Sierra SDK seems to require an id<NSApplicationDelegate>
for its setDelegate: call.

To accomplish this, split off the existing adoption of
NSFileManagerDelegate into a seperate class extension.

Then, add another class extension for conforming to the
NSApplicationDelegate protocol.

Both of them are gated with MAC_OS_X_VERSION_MAX_ALLOWED
to allow building with older SDKs.
  • Loading branch information
mkrautz committed Nov 25, 2016
1 parent 64d730a commit f01f6e5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions macx/compat/compat.m
Expand Up @@ -6,10 +6,17 @@
#import <AppKit/AppKit.h>

@interface CompatApp : NSObject
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
<NSFileManagerDelegate>
@end

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
@interface CompatApp (NSApplicationDelegateExtension) <NSApplicationDelegate>
@end
#endif

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
@interface CompatApp (NSFileManagerDelegateExtension) <NSFileManagerDelegate>
@end
#endif

@implementation CompatApp

Expand Down

0 comments on commit f01f6e5

Please sign in to comment.