From d8b4dcb349e34994c37da3f4520a1120107bc471 Mon Sep 17 00:00:00 2001 From: Oliver Jones Date: Fri, 30 Nov 2012 17:47:14 +1100 Subject: [PATCH] Fixes warning: 'macro' is not defined, evaluates to 0 --- AFNetworking/AFImageRequestOperation.h | 18 +++++++++--------- .../AFNetworkActivityIndicatorManager.h | 2 +- .../AFNetworkActivityIndicatorManager.m | 2 +- AFNetworking/AFURLConnectionOperation.h | 2 +- AFNetworking/AFURLConnectionOperation.m | 8 ++++---- AFNetworking/UIImageView+AFNetworking.m | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/AFNetworking/AFImageRequestOperation.h b/AFNetworking/AFImageRequestOperation.h index d028a84..b906783 100644 --- a/AFNetworking/AFImageRequestOperation.h +++ b/AFNetworking/AFImageRequestOperation.h @@ -25,9 +25,9 @@ #import -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) #import -#elif __MAC_OS_X_VERSION_MIN_REQUIRED +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) #import #endif @@ -54,13 +54,13 @@ /** An image constructed from the response data. If an error occurs during the request, `nil` will be returned, and the `error` property will be set to the error. */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) @property (readonly, nonatomic, strong) UIImage *responseImage; -#elif __MAC_OS_X_VERSION_MIN_REQUIRED +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) @property (readonly, nonatomic, strong) NSImage *responseImage; #endif -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) /** The scale factor used when interpreting the image data to construct `responseImage`. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance. */ @@ -75,10 +75,10 @@ @return A new image request operation */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + (AFImageRequestOperation *)imageRequestOperationWithRequest:(NSURLRequest *)urlRequest success:(void (^)(UIImage *image))success; -#elif __MAC_OS_X_VERSION_MIN_REQUIRED +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) + (AFImageRequestOperation *)imageRequestOperationWithRequest:(NSURLRequest *)urlRequest success:(void (^)(NSImage *image))success; #endif @@ -93,12 +93,12 @@ @return A new image request operation */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED + (AFImageRequestOperation *)imageRequestOperationWithRequest:(NSURLRequest *)urlRequest imageProcessingBlock:(UIImage *(^)(UIImage *image))imageProcessingBlock success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure; -#elif __MAC_OS_X_VERSION_MIN_REQUIRED +#elifdef __MAC_OS_X_VERSION_MIN_REQUIRED + (AFImageRequestOperation *)imageRequestOperationWithRequest:(NSURLRequest *)urlRequest imageProcessingBlock:(NSImage *(^)(NSImage *image))imageProcessingBlock success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSImage *image))success diff --git a/AFNetworking/AFNetworkActivityIndicatorManager.h b/AFNetworking/AFNetworkActivityIndicatorManager.h index 2b4d54c..7b6cbe7 100644 --- a/AFNetworking/AFNetworkActivityIndicatorManager.h +++ b/AFNetworking/AFNetworkActivityIndicatorManager.h @@ -24,7 +24,7 @@ #import -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) #import /** diff --git a/AFNetworking/AFNetworkActivityIndicatorManager.m b/AFNetworking/AFNetworkActivityIndicatorManager.m index a67cfec..afb6f00 100644 --- a/AFNetworking/AFNetworkActivityIndicatorManager.m +++ b/AFNetworking/AFNetworkActivityIndicatorManager.m @@ -24,7 +24,7 @@ #import "AFHTTPRequestOperation.h" -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17; @interface AFNetworkActivityIndicatorManager () diff --git a/AFNetworking/AFURLConnectionOperation.h b/AFNetworking/AFURLConnectionOperation.h index 3a391b0..a6be720 100644 --- a/AFNetworking/AFURLConnectionOperation.h +++ b/AFNetworking/AFURLConnectionOperation.h @@ -184,7 +184,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 __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler; #endif diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index 1f90136..25432a9 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -21,7 +21,7 @@ // THE SOFTWARE. #import "AFURLConnectionOperation.h" -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) #import #endif @@ -39,7 +39,7 @@ typedef enum { typedef signed short AFOperationState; -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) typedef UIBackgroundTaskIdentifier AFBackgroundTaskIdentifier; #else typedef id AFBackgroundTaskIdentifier; @@ -196,7 +196,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat _outputStream = nil; } -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) if (_backgroundTaskIdentifier) { [[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier]; _backgroundTaskIdentifier = UIBackgroundTaskInvalid; @@ -249,7 +249,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat [self didChangeValueForKey:@"outputStream"]; } -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler { [self.lock lock]; if (!self.backgroundTaskIdentifier) { diff --git a/AFNetworking/UIImageView+AFNetworking.m b/AFNetworking/UIImageView+AFNetworking.m index 1294d61..f399c0e 100644 --- a/AFNetworking/UIImageView+AFNetworking.m +++ b/AFNetworking/UIImageView+AFNetworking.m @@ -23,7 +23,7 @@ #import #import -#if __IPHONE_OS_VERSION_MIN_REQUIRED +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) #import "UIImageView+AFNetworking.h" @interface AFImageCache : NSCache