Skip to content

Commit

Permalink
conditionalize usage of 10.6-only protocols
Browse files Browse the repository at this point in the history
David Catmull (Uncommon)
Uncommon/gitx@e5b603f188760d341ca5c578ee9a42ebcc46ba4b

Conflicts:

	DBPrefsWindowController.h
	PBGitHistoryController.h
	PBGitSidebarController.h
	PBGitWindowController.h
  • Loading branch information
laullon committed May 18, 2011
1 parent 2f828bb commit 94efa43
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DBPrefsWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#import <Cocoa/Cocoa.h>


@interface DBPrefsWindowController : NSWindowController /*<NSAnimationDelegate,NSToolbarDelegate>*/{
@interface DBPrefsWindowController : NSWindowController PROTOCOL_10_6(NSAnimationDelegate,NSToolbarDelegate){
NSMutableArray *toolbarIdentifiers;
NSMutableDictionary *toolbarViews;
NSMutableDictionary *toolbarItems;
Expand Down
13 changes: 13 additions & 0 deletions GitX_Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@
#ifndef ALog
#define ALog(...) DLog(__VA_ARGS__)
#endif

// In 10.6, some NSObject categories (like NSWindowDelegate) were changed to
// protocols. Thus to avoid warnings we need to add protocol specifiers, but
// only when compiling for 10.6+.
#ifndef MAC_OS_X_VERSION_10_6
#define MAC_OS_X_VERSION_10_6 1060
#endif

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
#define PROTOCOL_10_6(...) <__VA_ARGS__>
#else
#define PROTOCOL_10_6(...)
#endif
2 changes: 1 addition & 1 deletion PBGitHistoryController.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@class PBHistorySearchController;

@interface PBGitHistoryController : PBViewController /*<NSOutlineViewDelegate>*/{
@interface PBGitHistoryController : PBViewController PROTOCOL_10_6(NSOutlineViewDelegate){
IBOutlet PBRefController *refController;
IBOutlet NSSearchField *searchField;
IBOutlet NSArrayController* commitController;
Expand Down
2 changes: 1 addition & 1 deletion PBGitSidebarController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@class PBGitHistoryController;
@class PBGitCommitController;

@interface PBGitSidebarController : PBViewController /*<NSOutlineViewDelegate>*/{
@interface PBGitSidebarController : PBViewController PROTOCOL_10_6(NSOutlineViewDelegate, NSMenuDelegate){
IBOutlet NSWindow *window;
IBOutlet NSOutlineView *sourceView;
IBOutlet NSView *sourceListControlsView;
Expand Down
2 changes: 1 addition & 1 deletion PBGitWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@class PBViewController, PBGitSidebarController, PBGitCommitController;

@interface PBGitWindowController : NSWindowController /*<NSWindowDelegate>*/{
@interface PBGitWindowController : NSWindowController PROTOCOL_10_6(NSWindowDelegate){
__weak PBGitRepository* repository;

PBViewController *contentController;
Expand Down

0 comments on commit 94efa43

Please sign in to comment.