2222#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
2323#endif
2424
25- // Does ARC support support GCD objects?
26- // It does if the minimum deployment target is iOS 6+ or Mac OS X 10.8+
27-
28- #if TARGET_OS_IPHONE
29-
30- // Compiling for iOS
31-
32- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
33- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
34- #else // iOS 5.X or earlier
35- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
36- #endif
37-
38- #else
39-
40- // Compiling for Mac OS X
41-
42- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
43- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
44- #else
45- #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
46- #endif
47-
48- #endif
49-
5025// We probably shouldn't be using DDLog() statements within the DDLog implementation.
5126// But we still want to leave our log statements for any future debugging,
5227// and to allow other developers to trace the implementation (which is a great learning tool).
@@ -805,7 +780,7 @@ - (id)initWithLogger:(id <DDLogger>)aLogger loggerQueue:(dispatch_queue_t)aLogge
805780
806781 if (aLoggerQueue) {
807782 loggerQueue = aLoggerQueue;
808- #if NEEDS_DISPATCH_RETAIN_RELEASE
783+ #if !OS_OBJECT_USE_OBJC
809784 dispatch_retain (loggerQueue);
810785 #endif
811786 }
@@ -820,7 +795,7 @@ + (DDLoggerNode *)nodeWithLogger:(id <DDLogger>)logger loggerQueue:(dispatch_que
820795
821796- (void )dealloc
822797{
823- #if NEEDS_DISPATCH_RETAIN_RELEASE
798+ #if !OS_OBJECT_USE_OBJC
824799 if (loggerQueue) dispatch_release (loggerQueue);
825800 #endif
826801}
@@ -977,7 +952,7 @@ - (id)init
977952
978953- (void )dealloc
979954{
980- #if NEEDS_DISPATCH_RETAIN_RELEASE
955+ #if !OS_OBJECT_USE_OBJC
981956 if (loggerQueue) dispatch_release (loggerQueue);
982957 #endif
983958}
0 commit comments