diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ext/socket/ancdata.c | 10 | ||||
-rw-r--r-- | ext/socket/extconf.rb | 8 |
3 files changed, 19 insertions, 5 deletions
@@ -1,3 +1,9 @@ +Tue Feb 3 07:57:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ext/socket/extconf.rb (in_pktinfo, in6_pktinfo), + ext/socket/ancdata.c: defined in w32api/ws2tcpip.h on cygwin but + cannot compile for some reason. + Tue Feb 3 07:02:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * missing/langinfo.c (nl_langinfo_codeset): accepts iso-8859 diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 5cc5c49d9..d62f0e558 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -188,7 +188,7 @@ ancillary_int(VALUE self) static VALUE ancillary_s_ip_pktinfo(VALUE self, VALUE v_addr, VALUE v_ifindex, VALUE v_spec_dst) { -#if defined(IPPROTO_IP) && defined(IP_PKTINFO) /* GNU/Linux */ +#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) /* GNU/Linux */ unsigned int ifindex; struct sockaddr_in sa; struct in_pktinfo pktinfo; @@ -226,7 +226,7 @@ ancillary_s_ip_pktinfo(VALUE self, VALUE v_addr, VALUE v_ifindex, VALUE v_spec_d static VALUE ancillary_ip_pktinfo(VALUE self) { -#if defined(IPPROTO_IP) && defined(IP_PKTINFO) /* GNU/Linux */ +#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) /* GNU/Linux */ int level, type; VALUE data; struct in_pktinfo pktinfo; @@ -397,7 +397,7 @@ anc_inspect_ip_recvdstaddr(int level, int type, VALUE data, VALUE ret) } #endif -#if defined(IPPROTO_IP) && defined(IP_PKTINFO) /* GNU/Linux */ +#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) /* GNU/Linux */ static int anc_inspect_ip_pktinfo(int level, int type, VALUE data, VALUE ret) { @@ -426,7 +426,7 @@ anc_inspect_ip_pktinfo(int level, int type, VALUE data, VALUE ret) } #endif -#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO) /* IPv6 RFC3542 */ +#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN6_PKTINFO) /* IPv6 RFC3542 */ static int anc_inspect_ipv6_pktinfo(int level, int type, VALUE data, VALUE ret) { @@ -508,7 +508,7 @@ ancillary_inspect(VALUE self) # if defined(IP_RECVDSTADDR) /* 4.4BSD */ case IP_RECVDSTADDR: if (anc_inspect_ip_recvdstaddr(level, type, data, ret) == -1) goto dump; break; # endif -# if defined(IP_PKTINFO) /* GNU/Linux */ +# if defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) /* GNU/Linux */ case IP_PKTINFO: if (anc_inspect_ip_pktinfo(level, type, data, ret) == -1) goto dump; break; # endif default: goto dump; diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index c82bacbe4..f4d92066b 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -299,6 +299,14 @@ end have_header("sys/un.h") have_header("sys/uio.h") +have_type("struct in_pktinfo") {|src| + src.sub(%r'^/\*top\*/', '\1'"\n#if defined(IPPROTO_IP) && defined(IP_PKTINFO)") << + "#else\n" << "#error\n" << ">>>>>> no in_pktinfo <<<<<<\n" << "#endif\n" +} +have_type("struct in6_pktinfo") {|src| + src.sub(%r'^/\*top\*/', '\1'"\n#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO)") << + "#else\n" << "#error\n" << ">>>>>> no in6_pktinfo <<<<<<\n" << "#endif\n" +} $distcleanfiles << "constants.h" << "constdefs.*" |