Skip to content

Commit 338f4bf

Browse files
committed
expand mainQueue guard for DEPLOYMENT_ENABLE_LIBDISPATCH
1 parent a2dd56b commit 338f4bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Foundation/NSOperation.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,15 +546,15 @@ public class NSOperationQueue : NSObject {
546546
}
547547

548548
public class func mainQueue() -> NSOperationQueue {
549+
#if DEPLOYMENT_ENABLE_LIBDISPATCH
549550
let specific = dispatch_queue_get_specific(dispatch_get_main_queue(), NSOperationQueue.OperationQueueKey)
550551
if specific == nil {
551-
#if DEPLOYMENT_ENABLE_LIBDISPATCH
552552
return NSOperationQueue(_queue: dispatch_get_main_queue(), maxConcurrentOperations: 1)
553-
#else
554-
fatalError("NSOperationQueue requires libdispatch")
555-
#endif
556553
} else {
557554
return Unmanaged<NSOperationQueue>.fromOpaque(unsafeBitCast(specific, to: OpaquePointer.self)).takeUnretainedValue()
558555
}
556+
#else
557+
fatalError("NSOperationQueue requires libdispatch")
558+
#endif
559559
}
560560
}

0 commit comments

Comments
 (0)