Skip to content

Commit 94efa43

Browse files
committed
conditionalize usage of 10.6-only protocols
David Catmull (Uncommon) Uncommon/gitx@e5b603f188760d341ca5c578ee9a42ebcc46ba4b Conflicts: DBPrefsWindowController.h PBGitHistoryController.h PBGitSidebarController.h PBGitWindowController.h
1 parent 2f828bb commit 94efa43

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

DBPrefsWindowController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#import <Cocoa/Cocoa.h>
4343

4444

45-
@interface DBPrefsWindowController : NSWindowController /*<NSAnimationDelegate,NSToolbarDelegate>*/{
45+
@interface DBPrefsWindowController : NSWindowController PROTOCOL_10_6(NSAnimationDelegate,NSToolbarDelegate){
4646
NSMutableArray *toolbarIdentifiers;
4747
NSMutableDictionary *toolbarViews;
4848
NSMutableDictionary *toolbarItems;

GitX_Prefix.pch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,16 @@
1717
#ifndef ALog
1818
#define ALog(...) DLog(__VA_ARGS__)
1919
#endif
20+
21+
// In 10.6, some NSObject categories (like NSWindowDelegate) were changed to
22+
// protocols. Thus to avoid warnings we need to add protocol specifiers, but
23+
// only when compiling for 10.6+.
24+
#ifndef MAC_OS_X_VERSION_10_6
25+
#define MAC_OS_X_VERSION_10_6 1060
26+
#endif
27+
28+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
29+
#define PROTOCOL_10_6(...) <__VA_ARGS__>
30+
#else
31+
#define PROTOCOL_10_6(...)
32+
#endif

PBGitHistoryController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
@class PBHistorySearchController;
2424

25-
@interface PBGitHistoryController : PBViewController /*<NSOutlineViewDelegate>*/{
25+
@interface PBGitHistoryController : PBViewController PROTOCOL_10_6(NSOutlineViewDelegate){
2626
IBOutlet PBRefController *refController;
2727
IBOutlet NSSearchField *searchField;
2828
IBOutlet NSArrayController* commitController;

PBGitSidebarController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@class PBGitHistoryController;
1414
@class PBGitCommitController;
1515

16-
@interface PBGitSidebarController : PBViewController /*<NSOutlineViewDelegate>*/{
16+
@interface PBGitSidebarController : PBViewController PROTOCOL_10_6(NSOutlineViewDelegate, NSMenuDelegate){
1717
IBOutlet NSWindow *window;
1818
IBOutlet NSOutlineView *sourceView;
1919
IBOutlet NSView *sourceListControlsView;

PBGitWindowController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
@class PBViewController, PBGitSidebarController, PBGitCommitController;
1616

17-
@interface PBGitWindowController : NSWindowController /*<NSWindowDelegate>*/{
17+
@interface PBGitWindowController : NSWindowController PROTOCOL_10_6(NSWindowDelegate){
1818
__weak PBGitRepository* repository;
1919

2020
PBViewController *contentController;

0 commit comments

Comments
 (0)