Permalink
Browse files

Merge pull request #139 from drodriguez/bye-bye-needs-dispatch-retain…

…-release

Remove uses of NEEDS_DISPATCH_RETAIN_RELEASE. Use OS_OBJECT_USE_OBJC.
  • Loading branch information...
2 parents 7662e11 + 2e7fe01 commit 96dac821ac605723445343f8ed186cb0e63b8e6c @robbiehanson committed Apr 2, 2013
View
@@ -6,32 +6,6 @@
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
-/**
- * Does ARC support support GCD objects?
- * It does if the minimum deployment target is iOS 6+ or Mac OS X 10.8+
-**/
-#if TARGET_OS_IPHONE
-
- // Compiling for iOS
-
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else // iOS 5.X or earlier
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
- #endif
-
-#else
-
- // Compiling for Mac OS X
-
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
- #endif
-
-#endif
-
// Log levels: off, error, warn, info, verbose
#if DEBUG
static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN;
@@ -60,7 +34,7 @@ - (id)initWithDispatchQueue:(dispatch_queue_t)queue
if (queue)
{
moduleQueue = queue;
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_retain(moduleQueue);
#endif
}
@@ -77,7 +51,7 @@ - (id)initWithDispatchQueue:(dispatch_queue_t)queue
- (void)dealloc
{
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_release(moduleQueue);
#endif
}
View
@@ -11,32 +11,6 @@
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
-/**
- * Does ARC support support GCD objects?
- * It does if the minimum deployment target is iOS 6+ or Mac OS X 10.8+
-**/
-#if TARGET_OS_IPHONE
-
- // Compiling for iOS
-
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else // iOS 5.X or earlier
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
- #endif
-
-#else
-
- // Compiling for Mac OS X
-
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
- #endif
-
-#endif
-
// Log levels: off, error, warn, info, verbose
#if DEBUG
static const int xmppLogLevel = XMPP_LOG_LEVEL_VERBOSE;
@@ -725,15 +699,15 @@ - (id)initWithDelegate:(id)aDelegate delegateQueue:(dispatch_queue_t)dq parserQu
delegate = aDelegate;
delegateQueue = dq;
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
if (delegateQueue)
dispatch_retain(delegateQueue);
#endif
if (pq) {
parserQueue = pq;
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_retain(parserQueue);
#endif
}
@@ -785,7 +759,7 @@ - (void)dealloc
xmlFreeParserCtxt(parserCtxt);
}
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
if (delegateQueue)
dispatch_release(delegateQueue);
if (parserQueue)
@@ -795,7 +769,7 @@ - (void)dealloc
- (void)setDelegate:(id)newDelegate delegateQueue:(dispatch_queue_t)newDelegateQueue
{
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
if (newDelegateQueue)
dispatch_retain(newDelegateQueue);
#endif
@@ -804,7 +778,7 @@ - (void)setDelegate:(id)newDelegate delegateQueue:(dispatch_queue_t)newDelegateQ
delegate = newDelegate;
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
if (delegateQueue)
dispatch_release(delegateQueue);
#endif
View
@@ -17,32 +17,6 @@
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
-/**
- * Does ARC support support GCD objects?
- * It does if the minimum deployment target is iOS 6+ or Mac OS X 10.8+
-**/
-#if TARGET_OS_IPHONE
-
- // Compiling for iOS
-
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else // iOS 5.X or earlier
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
- #endif
-
-#else
-
- // Compiling for Mac OS X
-
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
- #endif
-
-#endif
-
// Log levels: off, error, warn, info, verbose
#if DEBUG
static const int xmppLogLevel = XMPP_LOG_LEVEL_INFO | XMPP_LOG_FLAG_SEND_RECV; // | XMPP_LOG_FLAG_TRACE;
@@ -277,7 +251,7 @@ - (id)initP2PFrom:(XMPPJID *)jid
**/
- (void)dealloc
{
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_release(xmppQueue);
dispatch_release(willSendIqQueue);
dispatch_release(willSendMessageQueue);
@@ -2548,7 +2522,7 @@ - (void)continueReceiveIQ:(XMPPIQ *)iq
[self sendElement:iqResponse];
}
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_release(delSemaphore);
dispatch_release(delGroup);
#endif
@@ -3818,7 +3792,7 @@ - (void)setupKeepAliveTimer
[self keepAlive];
}});
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_source_t theKeepAliveTimer = keepAliveTimer;
dispatch_source_set_cancel_handler(keepAliveTimer, ^{
@@ -4282,7 +4256,7 @@ - (BOOL)wait:(NSTimeInterval)timeout_seconds
- (void)dealloc
{
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_release(semaphore);
#endif
}
@@ -12,32 +12,6 @@
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
-/**
- * Does ARC support support GCD objects?
- * It does if the minimum deployment target is iOS 6+ or Mac OS X 10.8+
-**/
-#if TARGET_OS_IPHONE
-
- // Compiling for iOS
-
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else // iOS 5.X or earlier
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
- #endif
-
-#else
-
- // Compiling for Mac OS X
-
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
- #endif
-
-#endif
-
// Log levels: off, error, warn, info, verbose
#if DEBUG
static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN;
@@ -845,7 +819,7 @@ - (void)dealloc
[[self class] unregisterDatabaseFileName:databaseFileName];
}
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
if (storageQueue)
dispatch_release(storageQueue);
#endif
@@ -7,32 +7,6 @@
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
-/**
- * Does ARC support support GCD objects?
- * It does if the minimum deployment target is iOS 6+ or Mac OS X 10.8+
-**/
-#if TARGET_OS_IPHONE
-
- // Compiling for iOS
-
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else // iOS 5.X or earlier
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
- #endif
-
-#else
-
- // Compiling for Mac OS X
-
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
- #endif
-
-#endif
-
#define IMPOSSIBLE_REACHABILITY_FLAGS 0xFFFFFFFF
// Log levels: off, error, warn, info, verbose
@@ -412,7 +386,7 @@ - (void)setupReconnectTimer
}});
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_source_t theReconnectTimer = reconnectTimer;
dispatch_source_set_cancel_handler(reconnectTimer, ^{
@@ -641,7 +615,7 @@ - (void)maybeAttemptReconnectWithReachabilityFlags:(SCNetworkReachabilityFlags)r
}});
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_release(delSemaphore);
dispatch_release(delGroup);
#endif
@@ -8,32 +8,6 @@
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
-/**
- * Does ARC support support GCD objects?
- * It does if the minimum deployment target is iOS 6+ or Mac OS X 10.8+
-**/
-#if TARGET_OS_IPHONE
-
- // Compiling for iOS
-
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else // iOS 5.X or earlier
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
- #endif
-
-#else
-
- // Compiling for Mac OS X
-
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
- #endif
-
-#endif
-
// Log levels: off, error, warn, info, verbose
#if DEBUG
static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN; // | XMPP_LOG_FLAG_TRACE;
@@ -83,7 +57,7 @@ - (BOOL)configureWithParent:(XMPPRoster *)aParent queue:(dispatch_queue_t)queue
parent = aParent;
parentQueue = queue;
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_retain(parentQueue);
#endif
@@ -96,7 +70,7 @@ - (BOOL)configureWithParent:(XMPPRoster *)aParent queue:(dispatch_queue_t)queue
- (void)dealloc
{
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
if (parentQueue)
dispatch_release(parentQueue);
#endif
@@ -16,32 +16,6 @@
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
-/**
- * Does ARC support support GCD objects?
- * It does if the minimum deployment target is iOS 6+ or Mac OS X 10.8+
-**/
-#if TARGET_OS_IPHONE
-
- // Compiling for iOS
-
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else // iOS 5.X or earlier
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
- #endif
-
-#else
-
- // Compiling for Mac OS X
-
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
- #else
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
- #endif
-
-#endif
-
// Log levels: off, error, warn, info, verbose
// Log flags: trace
#if DEBUG
@@ -83,7 +57,7 @@ - (id)initWithRpcID:(NSString *)aRpcID timer:(dispatch_source_t)aTimer
rpcID = [aRpcID copy];
timer = aTimer;
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_retain(timer);
#endif
}
@@ -105,7 +79,7 @@ - (void)cancelTimer
if (timer)
{
dispatch_source_cancel(timer);
- #if NEEDS_DISPATCH_RETAIN_RELEASE
+ #if !OS_OBJECT_USE_OBJC
dispatch_release(timer);
#endif
timer = NULL;
Oops, something went wrong.

0 comments on commit 96dac82

Please sign in to comment.