Fix Swift 5.5 (#162)

This commit is contained in:
David Nadoba 2022-10-13 14:47:28 +01:00 committed by GitHub
parent 330f4ee104
commit de5ea3d0b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -103,6 +103,10 @@ public enum NIOTSNetworkEvents {
} }
} }
// Network.framework has not adopted `Sendable` yet.
// We therefore need to import it with `@preconcurrency`.
// `@preconcurrency` is only available in Swift 5.6.
#if swift(>=5.6)
@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) @available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
extension NIOTSNetworkEvents.BetterPathAvailable: Sendable {} extension NIOTSNetworkEvents.BetterPathAvailable: Sendable {}
@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) @available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
@ -115,5 +119,6 @@ extension NIOTSNetworkEvents.ConnectToNWEndpoint: Sendable {}
extension NIOTSNetworkEvents.BindToNWEndpoint: Sendable {} extension NIOTSNetworkEvents.BindToNWEndpoint: Sendable {}
@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) @available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
extension NIOTSNetworkEvents.WaitingForConnectivity: Sendable {} extension NIOTSNetworkEvents.WaitingForConnectivity: Sendable {}
#endif
#endif #endif