diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/socket/extconf.rb | 4 | ||||
-rw-r--r-- | ext/socket/socket.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 41b715e0af..7a8c153210 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -33,6 +33,9 @@ if /solaris/ =~ RUBY_PLATFORM and !try_compile("") # bug of gcc 3.0 on Solaris 8 ? headers << "sys/feature_tests.h" end +if have_header("arpa/inet.h") + headers << "arpa/inet.h" +end ipv6 = false default_ipv6 = /cygwin/ !~ RUBY_PLATFORM @@ -252,7 +255,6 @@ 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") - have_header("arpa/inet.h") have_header("arpa/nameser.h") have_header("resolv.h") end diff --git a/ext/socket/socket.c b/ext/socket/socket.c index b4f44c9247..89569f9a06 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -42,6 +42,9 @@ #ifdef HAVE_NETINET_UDP_H # include <netinet/udp.h> #endif +#ifdef HAVE_ARPA_INET_H +# include <arpa/inet.h> +#endif #include <netdb.h> #endif #include <errno.h> |