Common.h revision e0ac7454bae910ab3d67a92f6e2e5046d3bb8c1a
1#if __has_feature(objc_arr)
2#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
3#else
4#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE
5#endif
6
7#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
8#define CF_CONSUMED __attribute__((cf_consumed))
9
10#define NS_INLINE static __inline__ __attribute__((always_inline))
11#define nil ((void*) 0)
12
13typedef int BOOL;
14typedef unsigned NSUInteger;
15typedef int int32_t;
16typedef unsigned char uint8_t;
17typedef int32_t UChar32;
18typedef unsigned char UChar;
19
20typedef struct _NSZone NSZone;
21
22typedef const void * CFTypeRef;
23CFTypeRef CFRetain(CFTypeRef cf);
24id CFBridgingRelease(CFTypeRef CF_CONSUMED X);
25
26NS_INLINE NS_RETURNS_RETAINED id NSMakeCollectable(CFTypeRef CF_CONSUMED cf) NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
27
28@protocol NSObject
29- (BOOL)isEqual:(id)object;
30- (NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
31- (id)retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
32- (NSUInteger)retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
33- (oneway void)release NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
34- (id)autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
35@end
36
37@interface NSObject <NSObject> {}
38- (id)init;
39
40+ (id)new;
41+ (id)alloc;
42- (void)dealloc;
43
44- (void)finalize;
45
46- (id)copy;
47- (id)mutableCopy;
48@end
49
50NS_AUTOMATED_REFCOUNT_UNAVAILABLE
51@interface NSAutoreleasePool : NSObject {
52@private
53    void    *_token;
54    void    *_reserved3;
55    void    *_reserved2;
56    void    *_reserved;
57}
58
59+ (void)addObject:(id)anObject;
60
61- (void)addObject:(id)anObject;
62
63- (void)drain;
64
65@end
66
67typedef const void* objc_objectptr_t;
68extern __attribute__((ns_returns_retained)) id objc_retainedObject(objc_objectptr_t __attribute__((cf_consumed)) pointer);
69extern __attribute__((ns_returns_not_retained)) id objc_unretainedObject(objc_objectptr_t pointer);
70extern objc_objectptr_t objc_unretainedPointer(id object);
71