Fix availability guards and compiler warnings (#195)

# Motivation
We missed a few availability guards in our tests which caused errors when compiling for older Darwin platforms.

# Modification
This PR adds the missing guards.

# Result
We should build on all supported platforms again
This commit is contained in:
Franz Busch 2023-12-08 13:02:43 +00:00 committed by GitHub
parent cb29107d4d
commit 8bf5a6b65f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ final class HTTP1ClientHandler: ChannelInboundHandler {
}
}
if #available(OSX 10.14, *) {
if #available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) {
let group = NIOTSEventLoopGroup()
let channel = try! NIOTSConnectionBootstrap(group: group)
.connectTimeout(.hours(1))

View File

@ -18,7 +18,7 @@ import NIOTransportServices
import NIOHTTP1
import Network
@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
@available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
final class HTTP1ServerHandler: ChannelInboundHandler {
typealias InboundIn = HTTPServerRequestPart
typealias OutboundOut = HTTPServerResponsePart
@ -37,7 +37,7 @@ final class HTTP1ServerHandler: ChannelInboundHandler {
}
}
if #available(OSX 10.14, *) {
if #available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) {
let group = NIOTSEventLoopGroup()
let channel = try! NIOTSListenerBootstrap(group: group)
.childChannelInitializer { channel in