Skip to content

Commit

Permalink
Support building with older sdks that don't define NS_DESIGNATED_INIT…
Browse files Browse the repository at this point in the history
…IALIZER

Work around an issue with older versions of clang: ( r203954 - Objective-C. Allow objc_designated_initializer for private ) http://permalink.gmane.org/gmane.comp.compilers.clang.scm/94822
  • Loading branch information
heardrwt committed Jul 14, 2014
1 parent f1d8ff3 commit 5abb3ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RHAddressBook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@
GCC_PREFIX_HEADER = "RHAddressBookTester/RHAddressBookTester-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
INFOPLIST_FILE = "RHAddressBookTester/RHAddressBookTester-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -727,6 +728,7 @@
GCC_PREFIX_HEADER = "RHAddressBookTester/RHAddressBookTester-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
INFOPLIST_FILE = "RHAddressBookTester/RHAddressBookTester-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
OTHER_LDFLAGS = "-ObjC";
Expand Down Expand Up @@ -955,6 +957,7 @@
13D1519E193E7688003B0F45 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
8 changes: 8 additions & 0 deletions RHAddressBook/RHAddressBook.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
#define RH_AB_INCLUDE_GEOCODING 0
#endif

//support building with older sdks that don't define NS_DESIGNATED_INITIALIZER
#ifndef NS_DESIGNATED_INITIALIZER
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
#else
#define NS_DESIGNATED_INITIALIZER
#endif
#endif

@class RHRecord;
@class RHSource;
Expand Down
2 changes: 1 addition & 1 deletion RHAddressBook/RHMultiValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>

#import "RHAddressBook.h"

@class RHMultiValue;
@class RHMutableMultiValue;
Expand Down
2 changes: 1 addition & 1 deletion RHAddressBook/RHRecord_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@interface RHRecord ()

//init (you should not call init on these objects yourself. instead use the [RHAddressBook newPerson] method)
-(instancetype)initWithAddressBook:(RHAddressBook*)addressBook recordRef:(ABRecordRef)recordRef NS_DESIGNATED_INITIALIZER;
-(instancetype)initWithAddressBook:(RHAddressBook*)addressBook recordRef:(ABRecordRef)recordRef /* NS_DESIGNATED_INITIALIZER (Xcode5: see http://permalink.gmane.org/gmane.comp.compilers.clang.scm/94822) */;

@end

0 comments on commit 5abb3ca

Please sign in to comment.