Merge pull request #3570 from juanfra684/patch-1

OpenBSD doesn't support AI_V4MAPPED
This commit is contained in:
Dominik Picheta 2015-12-04 15:29:56 +00:00
commit 6f09282352

View file

@ -203,8 +203,10 @@ proc getAddrInfo*(address: string, port: Port, domain: Domain = AF_INET,
hints.ai_family = toInt(domain)
hints.ai_socktype = toInt(sockType)
hints.ai_protocol = toInt(protocol)
# OpenBSD doesn't support AI_V4MAPPED and doesn't define the macro AI_V4MAPPED.
# FreeBSD doesn't support AI_V4MAPPED but defines the macro.
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198092
when not defined(freebsd):
when not defined(freebsd) or defined(openbsd):
hints.ai_flags = AI_V4MAPPED
var gaiResult = getaddrinfo(address, $port, addr(hints), result)
if gaiResult != 0'i32: