diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-12 17:59:45 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-12 17:59:45 +0000 |
| commit | a1b7169f61bf6c6c8ef021d8b77d43e4d46a2207 (patch) | |
| tree | 403e5067f2e86dab4f563d5cef5f56c976e53a00 /ext/socket | |
| parent | e9d316638f9da8f44ba69639861d3f407fc28f80 (diff) | |
| download | ruby-a1b7169f61bf6c6c8ef021d8b77d43e4d46a2207.tar.gz ruby-a1b7169f61bf6c6c8ef021d8b77d43e4d46a2207.tar.xz ruby-a1b7169f61bf6c6c8ef021d8b77d43e4d46a2207.zip | |
* ext/socket/extconf.rb: use headers instead of "netdb.h" in checking
getnameinfo() and getaddrinfo() because Windows doesn't have it.
see [ruby-dev:37757].
* ext/socket/sockport.h (SA_LEN): use sockaddr_in6 when defined AF_INET6
if INET6 is not defined. winsock2's getaddrinfo() returns
sockaddr_in6 if ipv6 is available.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
| -rw-r--r-- | ext/socket/extconf.rb | 2 | ||||
| -rw-r--r-- | ext/socket/sockport.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 35ed282e1..06011d61a 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -244,7 +244,7 @@ end $objs = ["socket.#{$OBJEXT}"] -unless getaddr_info_ok and have_func("getnameinfo", "netdb.h") and have_func("getaddrinfo", "netdb.h") +unless getaddr_info_ok and have_func("getnameinfo", headers) and have_func("getaddrinfo", headers) if have_struct_member("struct in6_addr", "s6_addr8", headers) $defs[-1] = "-DHAVE_ADDR8" end diff --git a/ext/socket/sockport.h b/ext/socket/sockport.h index 1bd7eb698..a00e5ea34 100644 --- a/ext/socket/sockport.h +++ b/ext/socket/sockport.h @@ -14,7 +14,7 @@ # ifdef HAVE_SA_LEN # define SA_LEN(sa) (sa)->sa_len # else -# ifdef INET6 +# ifdef AF_INET6 # define SA_LEN(sa) \ (((sa)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \ : sizeof(struct sockaddr)) |
