diff options
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r-- | ext/socket/extconf.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 06011d61a8..99deaf8793 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -254,6 +254,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 |