From 68acc3f9cec6786ab0f9c3b39409a5b1f6e6ea22 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 22 Mar 2022 18:41:39 -0700 Subject: [PATCH] swift: remove Windows special case in `Block.swift` --- src/swift/Block.swift | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/swift/Block.swift b/src/swift/Block.swift index d7784ef2f..6459ba786 100644 --- a/src/swift/Block.swift +++ b/src/swift/Block.swift @@ -40,15 +40,7 @@ public class DispatchWorkItem { internal var _block: _DispatchBlock public init(qos: DispatchQoS = .unspecified, flags: DispatchWorkItemFlags = [], block: @escaping @convention(block) () -> ()) { -#if os(Windows) -#if arch(arm64) || arch(x86_64) - let flags = dispatch_block_flags_t(UInt32(flags.rawValue)) -#else - let flags = dispatch_block_flags_t(UInt(flags.rawValue)) -#endif -#else - let flags: dispatch_block_flags_t = numericCast(flags.rawValue) -#endif + let flags: dispatch_block_flags_t = dispatch_block_flags_t(CUnsignedLong(flags.rawValue)) _block = dispatch_block_create_with_qos_class(flags, qos.qosClass.rawValue.rawValue, Int32(qos.relativePriority), block) } @@ -56,15 +48,7 @@ public class DispatchWorkItem { // Used by DispatchQueue.synchronously to provide a path through // dispatch_block_t, as we know the lifetime of the block in question. internal init(flags: DispatchWorkItemFlags = [], noescapeBlock: () -> ()) { -#if os(Windows) -#if arch(arm64) || arch(x86_64) - let flags = dispatch_block_flags_t(UInt32(flags.rawValue)) -#else - let flags = dispatch_block_flags_t(UInt(flags.rawValue)) -#endif -#else - let flags: dispatch_block_flags_t = numericCast(flags.rawValue) -#endif + let flags: dispatch_block_flags_t = dispatch_block_flags_t(CUnsignedLong(flags.rawValue)) _block = _swift_dispatch_block_create_noescape(flags, noescapeBlock) }