diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-15 19:23:05 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-15 19:23:05 -0700 |
| commit | 59ee3628d5db511ce5527ce4ddbf126e929d7da8 (patch) | |
| tree | b50ee899adbc7a1066f8b0ced2316773ee2f064e /src/platform/windows | |
| parent | f69b4c1da69d1e9c513ad63da488a49b6b46a706 (diff) | |
| download | nng-59ee3628d5db511ce5527ce4ddbf126e929d7da8.tar.gz nng-59ee3628d5db511ce5527ce4ddbf126e929d7da8.tar.bz2 nng-59ee3628d5db511ce5527ce4ddbf126e929d7da8.zip | |
fixes #430 Unable to build in MSYS + Win-builds
fixes #438 Consider dropping AI_V4MAPPED
Diffstat (limited to 'src/platform/windows')
| -rw-r--r-- | src/platform/windows/win_resolv.c | 5 | ||||
| -rw-r--r-- | src/platform/windows/win_tcp.c | 10 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/platform/windows/win_resolv.c b/src/platform/windows/win_resolv.c index 2bc68c32..54f1c61c 100644 --- a/src/platform/windows/win_resolv.c +++ b/src/platform/windows/win_resolv.c @@ -127,15 +127,12 @@ win_resolv_task(void *arg) // We treat these all as IP addresses. The service and the // host part are split. memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV; if (item->passive) { hints.ai_flags |= AI_PASSIVE; } - hints.ai_flags |= AI_ADDRCONFIG; hints.ai_protocol = item->proto; hints.ai_family = item->family; - if (item->family == AF_INET6) { - hints.ai_flags |= AI_V4MAPPED; - } rv = getaddrinfo(item->name, item->serv, &hints, &results); if (rv != 0) { diff --git a/src/platform/windows/win_tcp.c b/src/platform/windows/win_tcp.c index 4d7d6027..33c4a1a5 100644 --- a/src/platform/windows/win_tcp.c +++ b/src/platform/windows/win_tcp.c @@ -680,17 +680,17 @@ nni_plat_tcp_ep_connect(nni_plat_tcp_ep *ep, nni_aio *aio) int nni_plat_tcp_ntop(const nni_sockaddr *sa, char *ipstr, char *portstr) { - const void *ap; - uint16_t port; - int af; + void * ap; + uint16_t port; + int af; switch (sa->s_family) { case NNG_AF_INET: - ap = &sa->s_in.sa_addr; + ap = (void *) &sa->s_in.sa_addr; port = sa->s_in.sa_port; af = AF_INET; break; case NNG_AF_INET6: - ap = &sa->s_in6.sa_addr; + ap = (void *) &sa->s_in6.sa_addr; port = sa->s_in6.sa_port; af = AF_INET6; break; |
