This repository has been archived by the owner on Jan 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ARCLogic.h
70 lines (64 loc) · 1.53 KB
/
ARCLogic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// ARCLogic.h
//
#ifndef ARCLOGIC
#define ARCLOGIC
#ifdef HASARC
#undef HASARC
#endif
#ifdef HASWEAK
#undef HASWEAK
#endif
#ifdef STRONG
#undef STRONG
#endif
#ifdef __STRONG
#undef __STRONG
#endif
#ifdef WEAK
#undef WEAK
#endif
#ifdef __WEAK
#undef __WEAK
#endif
#ifdef es_dispatch_release
#undef es_dispatch_release
#endif
#ifdef es_dispatch_retain
#undef es_dispatch_retain
#endif
#define HASARC __has_feature(objc_arc)
#define HASWEAK __has_feature(objc_arc_weak)
#if HASARC
#define IF_ARC(ARCBlock, NoARCBlock) ARCBlock
#define NO_ARC(NoARCBlock)
#define STRONG strong
#define __STRONG __strong
#if HASWEAK
#define __WEAK __weak
#define WEAK weak
#define NO_WEAK(NoWeakBlock)
#else
#define WEAK assign
#define __WEAK __unsafe_unretained
#define NO_WEAK(NoWeakBlock) NoWeakBlock
#endif
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 || MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
#define es_dispatch_release(dispatch_object)
#define es_dispatch_retain(dispatch_object)
#else
#define es_dispatch_release(dispatch_object) dispatch_release(dispatch_object)
#define es_dispatch_retain(dispatch_object) dispatch_retain(dispatch_object)
#endif
#else
#define IF_ARC(ARCBlock, NoARCBlock) NoARCBlock
#define NO_ARC(NoARCBlock) NoARCBlock
#define STRONG retain
#define __STRONG
#define WEAK assign
#define __WEAK
#define NO_WEAK(NoWeakBlock) NoWeakBlock
#define es_dispatch_release(dispatch_object) dispatch_release(dispatch_object)
#define es_dispatch_retain(dispatch_object) dispatch_retain(dispatch_object)
#endif
#endif