ABI fixes for OSX/BSD; fixes #6860 (#11666)

This commit is contained in:
Andreas Rumpf 2019-07-06 13:00:29 +02:00 • committed by GitHub
commit 02b9af2f75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 613 additions and 11 deletions

View file

@ -46,7 +46,7 @@ proc createServer(port: Port) {.async.} =
var server = createAsyncNativeSocket()
block:
var name: Sockaddr_in
name.sin_family = toInt(AF_INET).uint16
name.sin_family = typeof(name.sin_family)(toInt(AF_INET))
name.sin_port = htons(uint16(port))
name.sin_addr.s_addr = htonl(INADDR_ANY)
if bindAddr(server.SocketHandle, cast[ptr SockAddr](addr(name)),