summaryrefslogtreecommitdiffstats
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-14 04:09:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-14 04:09:05 +0000
commit48dc3f0ac72847a20eab4d2532568229ed0cbbc7 (patch)
tree931fc3d39d191eaa0842633e028a1de0ebc1b480 /ext/socket/extconf.rb
parent81d5b6b07d678cbe433a78ac98ba5b80aada14fd (diff)
downloadruby-48dc3f0ac72847a20eab4d2532568229ed0cbbc7.tar.gz
ruby-48dc3f0ac72847a20eab4d2532568229ed0cbbc7.tar.xz
ruby-48dc3f0ac72847a20eab4d2532568229ed0cbbc7.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@21505 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 443dd7d21..4d9f4e43a 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -255,6 +255,19 @@ unless getaddr_info_ok and have_func("getnameinfo", headers) and have_func("geta
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