mirror of
https://github.com/darlinghq/darling-objc4.git
synced 2024-11-26 21:50:26 +00:00
Support older clang versions
This commit is contained in:
parent
b32a584e88
commit
9840e980d5
@ -1978,6 +1978,16 @@ void arr_init(void)
|
||||
_objc_associations_init();
|
||||
}
|
||||
|
||||
#ifdef DARLING
|
||||
// see libdispatch
|
||||
#if __has_attribute(objc_nonlazy_class)
|
||||
#define NONLAZY_CLASS __attribute__((objc_nonlazy_class))
|
||||
#define NONLAZY_CLASS_LOAD
|
||||
#else
|
||||
#define NONLAZY_CLASS
|
||||
#define NONLAZY_CLASS_LOAD + (void)load {}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if SUPPORT_TAGGED_POINTERS
|
||||
|
||||
@ -1987,8 +1997,15 @@ void arr_init(void)
|
||||
@interface __NSUnrecognizedTaggedPointer : NSObject
|
||||
@end
|
||||
|
||||
#ifdef DARLING
|
||||
NONLAZY_CLASS
|
||||
#else
|
||||
__attribute__((objc_nonlazy_class))
|
||||
#endif
|
||||
@implementation __NSUnrecognizedTaggedPointer
|
||||
#ifdef DARLING
|
||||
NONLAZY_CLASS_LOAD
|
||||
#endif
|
||||
-(id) retain { return self; }
|
||||
-(oneway void) release { }
|
||||
-(id) autorelease { return self; }
|
||||
@ -1996,8 +2013,15 @@ __attribute__((objc_nonlazy_class))
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DARLING
|
||||
NONLAZY_CLASS
|
||||
#else
|
||||
__attribute__((objc_nonlazy_class))
|
||||
#endif
|
||||
@implementation NSObject
|
||||
#ifdef DARLING
|
||||
NONLAZY_CLASS_LOAD
|
||||
#endif
|
||||
|
||||
+ (void)initialize {
|
||||
}
|
||||
|
@ -45,21 +45,47 @@
|
||||
// by CF, so __IncompleteProtocol would be left without an R/R implementation
|
||||
// otherwise, which would break ARC.
|
||||
|
||||
#ifdef DARLING
|
||||
// see libdispatch
|
||||
#if __has_attribute(objc_nonlazy_class)
|
||||
#define NONLAZY_CLASS __attribute__((objc_nonlazy_class))
|
||||
#define NONLAZY_CLASS_LOAD
|
||||
#else
|
||||
#define NONLAZY_CLASS
|
||||
#define NONLAZY_CLASS_LOAD + (void)load {}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@interface __IncompleteProtocol : NSObject
|
||||
@end
|
||||
|
||||
#if __OBJC2__
|
||||
#ifdef DARLING
|
||||
NONLAZY_CLASS
|
||||
#else
|
||||
__attribute__((objc_nonlazy_class))
|
||||
#endif
|
||||
#endif
|
||||
@implementation __IncompleteProtocol
|
||||
#ifdef DARLING
|
||||
NONLAZY_CLASS_LOAD
|
||||
#endif
|
||||
@end
|
||||
|
||||
|
||||
#if __OBJC2__
|
||||
#ifdef DARLING
|
||||
NONLAZY_CLASS
|
||||
#else
|
||||
__attribute__((objc_nonlazy_class))
|
||||
#endif
|
||||
#endif
|
||||
@implementation Protocol
|
||||
|
||||
#ifdef DARLING
|
||||
NONLAZY_CLASS_LOAD
|
||||
#endif
|
||||
|
||||
- (BOOL) conformsTo: (Protocol *)aProtocolObj
|
||||
{
|
||||
return protocol_conformsToProtocol(self, aProtocolObj);
|
||||
|
Loading…
Reference in New Issue
Block a user