Browse Source

[Issue #2346] Fix preprocessor directive to pass if __has_feature is unavailable

Mattt Thompson 11 years ago
parent
commit
6be6cd25c7

+ 1 - 1
AFNetworking/AFURLConnectionOperation.h

@@ -248,7 +248,7 @@
 
  @param handler A handler to be called shortly before the application’s remaining background time reaches 0. The handler is wrapped in a block that cancels the operation, and cleans up and marks the end of execution, unlike the `handler` parameter in `UIApplication -beginBackgroundTaskWithExpirationHandler:`, which expects this to be done in the handler itself. The handler is called synchronously on the main thread, thus blocking the application’s suspension momentarily while the application is notified.
   */
-#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (defined(__has_feature) && !__has_feature(attribute_availability_app_extension))
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
 - (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler;
 #endif
 

+ 3 - 3
AFNetworking/AFURLConnectionOperation.m

@@ -38,7 +38,7 @@ typedef NS_ENUM(NSInteger, AFOperationState) {
     AFOperationFinishedState    = 3,
 };
 
-#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (defined(__has_feature) && !__has_feature(attribute_availability_app_extension))
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
 typedef UIBackgroundTaskIdentifier AFBackgroundTaskIdentifier;
 #else
 typedef id AFBackgroundTaskIdentifier;
@@ -211,7 +211,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
         _outputStream = nil;
     }
     
-#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (defined(__has_feature) && !__has_feature(attribute_availability_app_extension))
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
     if (_backgroundTaskIdentifier) {
         [[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier];
         _backgroundTaskIdentifier = UIBackgroundTaskInvalid;
@@ -289,7 +289,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
     [self.lock unlock];
 }
 
-#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (defined(__has_feature) && !__has_feature(attribute_availability_app_extension))
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
 - (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler {
     [self.lock lock];
     if (!self.backgroundTaskIdentifier) {

+ 1 - 1
UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m

@@ -114,7 +114,7 @@ static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notificat
 }
 
 - (void)updateNetworkActivityIndicatorVisibility {
-#if defined(__has_feature) && !__has_feature(attribute_availability_app_extension)
+#if !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
     [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]];
 #endif
 }