Jabber Guest iOS SDK
ARCMacros.h
1 //
2 // ARCMacros.h
3 //
4 // Created by John Blanco on 1/28/2011.
5 // Rapture In Venice releases all rights to this code. Feel free use and/or copy it openly and freely!
6 //
7 
8 #define FP_DEBUG
9 
10 #if !defined(__clang__) || __clang_major__ < 3
11  #ifndef __bridge
12  #define __bridge
13  #endif
14 
15  #ifndef __bridge_retain
16  #define __bridge_retain
17  #endif
18 
19  #ifndef __bridge_retained
20  #define __bridge_retained
21  #endif
22 
23  #ifndef __autoreleasing
24  #define __autoreleasing
25  #endif
26 
27  #ifndef __strong
28  #define __strong
29  #endif
30 
31  #ifndef __unsafe_unretained
32  #define __unsafe_unretained
33  #endif
34 
35  #ifndef __weak
36  #define __weak
37  #endif
38 #endif
39 
40 #if __has_feature(objc_arc)
41  #define SAFE_ARC_PROP_RETAIN strong
42  #define SAFE_ARC_RETAIN(x) (x)
43  #define SAFE_ARC_RELEASE(x)
44  #define SAFE_ARC_AUTORELEASE(x) (x)
45  #define SAFE_ARC_BLOCK_COPY(x) (x)
46  #define SAFE_ARC_BLOCK_RELEASE(x)
47  #define SAFE_ARC_SUPER_DEALLOC()
48  #define SAFE_ARC_AUTORELEASE_POOL_START() @autoreleasepool {
49  #define SAFE_ARC_AUTORELEASE_POOL_END() }
50 #else
51  #define SAFE_ARC_PROP_RETAIN retain
52  #define SAFE_ARC_RETAIN(x) ([(x) retain])
53  #define SAFE_ARC_RELEASE(x) ([(x) release])
54  #define SAFE_ARC_AUTORELEASE(x) ([(x) autorelease])
55  #define SAFE_ARC_BLOCK_COPY(x) (Block_copy(x))
56  #define SAFE_ARC_BLOCK_RELEASE(x) (Block_release(x))
57  #define SAFE_ARC_SUPER_DEALLOC() ([super dealloc])
58  #define SAFE_ARC_AUTORELEASE_POOL_START() NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
59  #define SAFE_ARC_AUTORELEASE_POOL_END() [pool release];
60 #endif
61 
62