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

@ -28,7 +28,7 @@ proc saveReceivedPort(port: int) =
proc prepareAddress(intaddr: uint32, intport: uint16): ptr Sockaddr_in =
result = cast[ptr Sockaddr_in](alloc0(sizeof(Sockaddr_in)))
result.sin_family = toInt(nativesockets.AF_INET).uint16
result.sin_family = typeof(result.sin_family)(toInt(nativesockets.AF_INET))
result.sin_port = nativesockets.htons(intport)
result.sin_addr.s_addr = nativesockets.htonl(intaddr)