swiftlang / swift-corelibs-libdispatch

The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware
swift.org
Apache License 2.0
2.47k stars 460 forks source link

swift: remove Windows special case in `Block.swift` #599

Closed compnerd closed 2 years ago

compnerd commented 2 years ago

DISPATCH_ENUM will use a typed enum which creates a typedef to an elaborated type. This fails to be imported into Swift as a numeric type. Explicitly convert the numericCast'ed value from the Swift OptionSet to the dispatch_block_flags_t as a portable alternate spelling. This allows us to continue to import the enum as a typed value.

Thanks to @beccadax for the pointer that this pattern may not work on Darwin (which it does not!) and the suggestion for the explicit type conversion!

compnerd commented 2 years ago

@swift-ci please test

compnerd commented 2 years ago

CC: @rokhinip

compnerd commented 2 years ago

@swift-ci please test

compnerd commented 2 years ago

@swift-ci please test

AreaZR commented 2 years ago

Any updates on this @compnerd

compnerd commented 2 years ago

Thanks for the reminder!