From d3a2ceef4b1dded7b773293124958405543566a9 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 2 Sep 2006 19:44:42 +0000 Subject: * ext/socket/extconf.rb: check arpa/inet.h for ntohs. * ext/socket/socket.c: include arpa/inet.h if available. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ ext/socket/extconf.rb | 4 +++- ext/socket/socket.c | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 03cf1e0dc..e8aebdbf6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Sep 3 04:40:42 2006 Tanaka Akira + + * ext/socket/extconf.rb: check arpa/inet.h for ntohs. + + * ext/socket/socket.c: include arpa/inet.h if available. + Sun Sep 3 04:03:06 2006 Tanaka Akira * ext/curses/curses.c: define _XOPEN_SOURCE_EXTENDED on HP-UX. diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 41b715e0a..7a8c15321 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 b4f44c924..89569f9a0 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -42,6 +42,9 @@ #ifdef HAVE_NETINET_UDP_H # include #endif +#ifdef HAVE_ARPA_INET_H +# include +#endif #include #endif #include -- cgit