NIOCore: add explicit type cast for Windows compatibility (#2156)

Windows does not have a `socklen_t` type, instead using `CInt` for the
value.  This adds an explicit type cast to repair the build on Windows.

Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
Saleem Abdulrasool 2022-06-06 05:28:23 -07:00 committed by GitHub
parent 9f9a0b2bc0
commit 38d8c7105c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -370,7 +370,7 @@ extension NIONetworkDevice {
try! NIOBSDSocket.inet_ntop(addressFamily: .inet,
addressBytes: &mask,
addressDescription: $0.baseAddress!,
addressDescriptionLength: INET_ADDRSTRLEN)
addressDescriptionLength: socklen_t(INET_ADDRSTRLEN))
}
return SocketAddress(mask)
}
@ -383,7 +383,7 @@ extension NIONetworkDevice {
try! NIOBSDSocket.inet_ntop(addressFamily: .inet6,
addressBytes: &mask,
addressDescription: $0.baseAddress!,
addressDescriptionLength: INET6_ADDRSTRLEN)
addressDescriptionLength: socklen_t(INET6_ADDRSTRLEN))
}
return SocketAddress(mask)
}