Skip to content

Commit

Permalink
Inverted preprocessor logic to check iff version exists in target
Browse files Browse the repository at this point in the history
  • Loading branch information
Caelin Jackson-King committed Jun 29, 2018
1 parent 54f1135 commit ca380fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions AFNetworking/AFCompatibilityMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
#define AF_CAN_USE_AT_AVAILABLE 0
#endif

#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 || __MAC_OS_VERSION_MAX_ALLOWED >= __MAC_OS_10_12 || __WATCH_OS_MAX_VERSION_ALLOWED >= __WATCH_OS_3_0 || __TV_OS_MAX_VERSION_ALLOWED >= __TV_OS_10_0)
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 1
#else
#if ((__IPHONE_OS_VERSION_MAX_ALLOWED && __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_10_0) || (__MAC_OS_VERSION_MAX_ALLOWED && __MAC_OS_VERSION_MAX_ALLOWED < __MAC_OS_10_12) ||(__WATCH_OS_MAX_VERSION_ALLOWED && __WATCH_OS_MAX_VERSION_ALLOWED < __WATCH_OS_3_0) ||(__TV_OS_MAX_VERSION_ALLOWED && __TV_OS_MAX_VERSION_ALLOWED < __TV_OS_10_0))
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 0
#else
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 1
#endif

#endif /* AFCompatibilityMacros_h */
2 changes: 1 addition & 1 deletion Tests/Tests/AFURLSessionManagerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ - (void)testDownloadTaskDoesReportProgress {

- (void)testSessionTaskDoesReportMetrics {
[self expectationForNotification:AFNetworkingTaskDidCompleteNotification object:nil handler:^BOOL(NSNotification * _Nonnull notification) {
#if AF_CAN_USE_AT_AVAILABLE
#if AF_CAN_USE_AT_AVAILABLE && AF_CAN_INCLUDE_SESSION_TASK_METRICS
if (@available(iOS 10, macOS 10.12, watchOS 3, tvOS 10, *)) {
return [notification userInfo][AFNetworkingTaskDidCompleteSessionTaskMetrics] != nil;
}
Expand Down

0 comments on commit ca380fd

Please sign in to comment.