summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-25 06:05:16 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-25 06:05:16 +0000
commit145f9e6fc5bc10e2c2fa1f6421f7066bb30dad91 (patch)
tree10370ffb0684953e86b305afae0f21f7aa76266b /ext/socket/extconf.rb
parent6eda1948e0458c9e81601e3acb3e179856632ca6 (diff)
merge revision(s) 21505:
* ext/socket/extconf.rb (gai_strerror): checks if available and if returns const pointer. * ext/socket/getaddrinfo.c (gai_strerror): defines only if non available. [ruby-core:21328] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@22617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 8a13ddba73..ece615865f 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -259,6 +259,19 @@ unless getaddr_info_ok and have_func("getnameinfo", "netdb.h") and have_func("ge
have_func("inet_ntop") or have_func("inet_ntoa")
have_func("inet_pton") or have_func("inet_aton")
have_func("getservbyport")
+ if have_func("gai_strerror")
+ unless checking_for("gai_strerror() returns const pointer") {!try_compile(<<EOF)}
+#{cpp_include(headers)}
+#include <stdlib.h>
+void
+conftest_gai_strerror_is_const()
+{
+ *gai_strerror(0) = 0;
+}
+EOF
+ $defs << "-DGAI_STRERROR_CONST"
+ end
+ end
have_header("arpa/nameser.h")
have_header("resolv.h")
end