ruby-dev MLe$B$N3’MM!"$O$8$a$^$7$F!#e(B
e$B>.DM$H$$$$$^$9!#e(B
e$B8=:_!“e(B1.8e$B7O!“e(B1.9e$B7O6&$K!“e(Bmswine$B$G$O@596K!$G$Oe(BIPv6e$B$,e(B
e$B$&$^$/;H$($:e(B(e$B%X%C%@$,ITE,@Z$J$?$ae(Bipv6e$B$NM-L5$,>o$K<:GT$9$ke(B)
e$BHa$7$$;W$$$r$7$F$$$^$9!#e(B
e$B0J2<$N$h$&$JJQ99$GDL$k$h$&$K$J$k$H;W$$$^$9$,!”$I$&$G$7$g$&$+!#e(B
(e$BB>$N%W%i%C%H%U%)!<%`$GIT6q9g$,$”$k$+$I$&$+L$8!>Z$G$9!#e(B
e$B$”$H!“e(BWinXPe$B$G:n$C$?%P%$%J%j$,e(B2ke$B$GF0$+$J$/$J$k$H$+$”$k$+$b$G$9e(B)
Index: ext/socket/extconf.rb
— ext/socket/extconf.rb (revision 16197)
+++ ext/socket/extconf.rb (working copy)
@@ -30,9 +30,24 @@
end
ipv6 = false
-default_ipv6 = /cygwin/ !~ RUBY_PLATFORM
-if enable_config(“ipv6”, default_ipv6)
- if checking_for(“ipv6”) {try_link(<<EOF)}
+case RUBY_PLATFORM
+when /bccwin32|mswin32|mingw/
- if enable_config(“ipv6”, true)
- if checking_for(“ipv6”) {try_link(<<EOF)}
+#{COMMON_HEADERS}
+main()
+{ - socket(AF_INET6, SOCK_STREAM, 0);
+}
+EOF -
$defs << "-DENABLE_IPV6" << "-DINET6"
-
ipv6 = true
- end
- end
+else - default_ipv6 = /cygwin/ !~ RUBY_PLATFORM
- if enable_config(“ipv6”, default_ipv6)
- if checking_for(“ipv6”) {try_link(<<EOF)}
#include <sys/types.h>
#include <sys/socket.h>
main()
@@ -40,8 +55,9 @@
socket(AF_INET6, SOCK_STREAM, 0);
}
EOF
- $defs << “-DENABLE_IPV6” << “-DINET6”
- ipv6 = true
-
$defs << "-DENABLE_IPV6" << "-DINET6"
-
ipv6 = true
- end
end
end
@@ -105,7 +121,13 @@
end
getaddr_info_ok = enable_config(“wide-getaddrinfo”) do
- wsastartup = <<EOF if $mswin or $bccwin or $mingw
- WSADATA wsaData;
- if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
- goto bad;
+EOF
checking_for(“wide getaddrinfo”) {try_run(<<EOF)}
+#{COMMON_HEADERS}
#{cpp_include(headers)}
#include <stdlib.h>
@@ -123,8 +145,9 @@
main()
{
int passive, gaierr, inet4 = 0, inet6 = 0;
- struct addrinfo hints, *ai, *aitop;
-
struct addrinfo hints, *ai, *aitop = NULL;
char straddr[INET6_ADDRSTRLEN], strport[16];
+#{wsastartup}for (passive = 0; passive <= 1; passive++) {
memset(&hints, 0, sizeof(hints));
@@ -234,7 +257,7 @@
$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
Index: include/ruby/win32.h
— include/ruby/win32.h (revision 16197)
+++ include/ruby/win32.h (working copy)
@@ -28,6 +28,7 @@
// #include <stdarg.h> conflict with varargs.h?
#if !defined(WSAAPI)
#include <winsock2.h>
+#include <ws2tcpip.h>
#endif
#define NT 1 /* deprecated */
Index: win32/Makefile.sub
— win32/Makefile.sub (revision 16197)
+++ win32/Makefile.sub (working copy)
@@ -260,7 +260,7 @@
COMMON_MACROS = WIN32_LEAN_AND_MEAN WIN32
!endif
!ifndef COMMON_HEADERS
-COMMON_HEADERS = winsock2.h windows.h
+COMMON_HEADERS = winsock2.h ws2tcpip.h windows.h
!endif
arch_hdrdir = $(EXTOUT)/include/$(arch)