diff options
author | takano32 <takano32@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-18 08:04:17 +0000 |
---|---|---|
committer | takano32 <takano32@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-18 08:04:17 +0000 |
commit | 867cd89920f99ecc316bc226323fc075d5bc7c51 (patch) | |
tree | 785cd8bf3c756d4e0431e3ee05f3f7ee1571be3e /ext/socket | |
parent | a8aa5c44fcacdb5e2b2c842d71aabe98a7570005 (diff) | |
download | ruby-867cd89920f99ecc316bc226323fc075d5bc7c51.tar.gz |
* ext/socket/ancdata.c: not use pktinfo.ipi_spec_dst if not defined
* ext/socket/extconf.rb: define HAVE_IPI_SPEC_DST
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r-- | ext/socket/ancdata.c | 8 | ||||
-rw-r--r-- | ext/socket/extconf.rb | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index d76cce98f8..34a5da317d 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -414,7 +414,7 @@ ancillary_int(VALUE self) static VALUE ancillary_s_ip_pktinfo(int argc, VALUE *argv, VALUE self) { -#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) /* GNU/Linux */ +#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) /* GNU/Linux */ VALUE v_addr, v_ifindex, v_spec_dst; unsigned int ifindex; struct sockaddr_in sa; @@ -477,7 +477,7 @@ ancillary_s_ip_pktinfo(int argc, VALUE *argv, VALUE self) static VALUE ancillary_ip_pktinfo(VALUE self) { -#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) /* GNU/Linux */ +#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) /* GNU/Linux */ int level, type; VALUE data; struct in_pktinfo pktinfo; @@ -790,7 +790,7 @@ anc_inspect_ip_recvdstaddr(int level, int type, VALUE data, VALUE ret) } #endif -#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) /* GNU/Linux */ +#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) /* GNU/Linux */ static int anc_inspect_ip_pktinfo(int level, int type, VALUE data, VALUE ret) { @@ -1042,7 +1042,7 @@ ancillary_inspect(VALUE self) # if defined(IP_RECVDSTADDR) /* 4.4BSD */ case IP_RECVDSTADDR: inspected = anc_inspect_ip_recvdstaddr(level, type, data, ret); break; # endif -# if defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) /* GNU/Linux */ +# if defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) /* GNU/Linux */ case IP_PKTINFO: inspected = anc_inspect_ip_pktinfo(level, type, data, ret); break; # endif } diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index ae2338d18b..79c9d30b36 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -310,6 +310,9 @@ have_type("struct in6_pktinfo", headers) {|src| src.sub(%r'^/\*top\*/', '\1'"\n#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO)") << "#else\n" << "#error\n" << ">>>>>> no in6_pktinfo <<<<<<\n" << "#endif\n" } +if have_struct_member("struct in_pktinfo", "ipi_spec_dst", headers) + $defs[-1] = "-DHAVE_IPI_SPEC_DST" +end have_type("struct sockcred", headers) have_type("struct cmsgcred", headers) |