Skip to content

Commit 21c0147

Browse files
committed
Foundation: remove unnecessary -DDEPLOYMENT_ENABLE_LIBDISPATCH
libdispatch is required by Foundation. Remove the single case where we depended on the flag to be set when building Foundation.
1 parent e6d968f commit 21c0147

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ add_swift_library(Foundation
269269
SWIFT_FLAGS
270270
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
271271
-DDEPLOYMENT_RUNTIME_SWIFT
272-
-DDEPLOYMENT_ENABLE_LIBDISPATCH
273272
-I;${ICU_INCLUDE_DIR}
274273
${libdispatch_cflags}
275274
$<$<BOOL:ENABLE_TESTING>:-enable-testing>
@@ -334,7 +333,6 @@ add_swift_library(FoundationNetworking
334333
-DDEPLOYMENT_RUNTIME_SWIFT
335334
-DNS_BUILDING_FOUNDATION_NETWORKING
336335
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
337-
-DDEPLOYMENT_ENABLE_LIBDISPATCH
338336
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
339337
${libdispatch_cflags}
340338
$<$<BOOL:ENABLE_TESTING>:-enable-testing>
@@ -376,7 +374,6 @@ add_swift_library(FoundationXML
376374
-DDEPLOYMENT_RUNTIME_SWIFT
377375
-DNS_BUILDING_FOUNDATION_NETWORKING
378376
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
379-
-DDEPLOYMENT_ENABLE_LIBDISPATCH
380377
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
381378
${libdispatch_cflags}
382379
$<$<BOOL:ENABLE_TESTING>:-enable-testing>

Foundation/NSData.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
//
99

1010
import CoreFoundation
11-
12-
#if DEPLOYMENT_ENABLE_LIBDISPATCH
1311
import Dispatch
14-
#endif
1512

1613
extension NSData {
1714
public struct ReadingOptions : OptionSet {
@@ -268,8 +265,7 @@ open class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
268265
} else if let data = value as? NSData {
269266
return isEqual(to: data._swiftObject)
270267
}
271-
272-
#if DEPLOYMENT_ENABLE_LIBDISPATCH
268+
273269
if let data = value as? DispatchData {
274270
if data.count != length {
275271
return false
@@ -279,7 +275,7 @@ open class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
279275
return memcmp(bytes1, bytes2, length) == 0
280276
}
281277
}
282-
#endif
278+
283279
return false
284280
}
285281

0 commit comments

Comments
 (0)