ruby-changes:27144
From: akr <ko1@a...>
Date: Sun, 10 Feb 2013 20:59:27 +0900 (JST)
Subject: [ruby-changes:27144] akr:r39196 (trunk): * ext/socket/extconf.rb: test types just after headers test.
akr 2013-02-10 20:58:53 +0900 (Sun, 10 Feb 2013) New Revision: 39196 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39196 Log: * ext/socket/extconf.rb: test types just after headers test. Modified files: trunk/ChangeLog trunk/ext/socket/extconf.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 39195) +++ ChangeLog (revision 39196) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Feb 10 20:58:17 2013 Tanaka Akira <akr@f...> + + * ext/socket/extconf.rb: test types just after headers test. + Sun Feb 10 16:00:00 2013 Zachary Scott <zachary@z...> * lib/rake/doc/MIT-LICENSE: Add license file from upstream Index: ext/socket/extconf.rb =================================================================== --- ext/socket/extconf.rb (revision 39195) +++ ext/socket/extconf.rb (revision 39196) @@ -54,6 +54,28 @@ have_header("sys/uio.h") https://github.com/ruby/ruby/blob/trunk/ext/socket/extconf.rb#L54 have_header("ucred.h", headers) +have_type("struct addrinfo", headers) + +unless have_type("socklen_t", headers) + $defs << "-Dsocklen_t=int" +end + +have_type("struct in_pktinfo", headers) {|src| + src.sub(%r'^/\*top\*/', '\&'"\n#if defined(IPPROTO_IP) && defined(IP_PKTINFO)") << + "#else\n" << "#error\n" << ">>>>>> no in_pktinfo <<<<<<\n" << "#endif\n" +} and have_struct_member("struct in_pktinfo", "ipi_spec_dst", headers) +have_type("struct in6_pktinfo", headers) {|src| + src.sub(%r'^/\*top\*/', '\&'"\n#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO)") << + "#else\n" << "#error\n" << ">>>>>> no in6_pktinfo <<<<<<\n" << "#endif\n" +} + +have_type("struct sockcred", headers) +have_type("struct cmsgcred", headers) + +have_type("struct ip_mreq", headers) # 4.4BSD +have_type("struct ip_mreqn", headers) # Linux 2.4 +have_type("struct ipv6_mreq", headers) # RFC 3493 + ipv6 = false default_ipv6 = /cygwin|beos|haiku/ !~ RUBY_PLATFORM if enable_config("ipv6", default_ipv6) @@ -397,7 +419,6 @@ Fatal: invalid value for --with-lookup-o https://github.com/ruby/ruby/blob/trunk/ext/socket/extconf.rb#L419 EOS end -have_type("struct addrinfo", headers) have_func("freehostent") have_func("freeaddrinfo") if /haiku/ !~ RUBY_PLATFORM and have_func("gai_strerror") @@ -453,32 +474,12 @@ have_func('inet_pton(0, "", (void *)0)') https://github.com/ruby/ruby/blob/trunk/ext/socket/extconf.rb#L474 have_func('getservbyport(0, "")') have_func("getifaddrs") -unless have_type("socklen_t", headers) - $defs << "-Dsocklen_t=int" -end - -have_type("struct in_pktinfo", headers) {|src| - src.sub(%r'^/\*top\*/', '\&'"\n#if defined(IPPROTO_IP) && defined(IP_PKTINFO)") << - "#else\n" << "#error\n" << ">>>>>> no in_pktinfo <<<<<<\n" << "#endif\n" -} and have_struct_member("struct in_pktinfo", "ipi_spec_dst", headers) -have_type("struct in6_pktinfo", headers) {|src| - src.sub(%r'^/\*top\*/', '\&'"\n#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO)") << - "#else\n" << "#error\n" << ">>>>>> no in6_pktinfo <<<<<<\n" << "#endif\n" -} - -have_type("struct sockcred", headers) -have_type("struct cmsgcred", headers) - have_func("getpeereid") have_func("getpeerucred") have_func("if_indextoname") -have_type("struct ip_mreq", headers) # 4.4BSD -have_type("struct ip_mreqn", headers) # Linux 2.4 -have_type("struct ipv6_mreq", headers) # RFC 3493 - # workaround for recent Windows SDK $defs << "-DIPPROTO_IPV6=IPPROTO_IPV6" if $defs.include?("-DHAVE_CONST_IPPROTO_IPV6") && !have_macro("IPPROTO_IPV6") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/