summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 15:36:29 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 15:36:29 +0000
commit9f1df8dd6e91afd8acfe7649a53ff331dee40b7f (patch)
tree75240b302a68dd52e61a9993dfe579ae98bcbe86 /ext
parent881c05817eb1d45adf437cdf2c731f5a61e069f6 (diff)
merges r21476 from trunk into ruby_1_9_1.
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/extconf.rb2
-rw-r--r--ext/socket/sockport.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 35ed282e17..06011d61a8 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 1bd7eb698b..a00e5ea34a 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))