From 05e2da638f2fbb5da018c9585dea066e9de5f979 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 1 Dec 2011 07:59:21 +0000 Subject: * ext/socket/extconf.rb: add arguments for macro calls. [ruby-core:41370] [Bug#5681] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/extconf.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext') diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 473f89f69e..5ff0f986c4 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -6,7 +6,6 @@ case RUBY_PLATFORM when /(ms|bcc)win(32|64)|mingw/ test_func = "WSACleanup" have_library("ws2_32", "WSACleanup") - $defs << "-DHAVE_SOCKETPAIR" when /cygwin/ test_func = "socket" when /beos/ @@ -430,9 +429,10 @@ if getaddr_info_ok == :wide or $defs << "-DGETADDRINFO_EMU" end -have_func("inet_ntop") or have_func("inet_ntoa") -have_func("inet_pton") or have_func("inet_aton") -have_func("getservbyport") +have_func('inet_ntop(0, (const void *)0, (char *)0, 0)') or + have_func("inet_ntoa(*(struct in_addr *)NULL)") +have_func('inet_pton(0, "", (void *)0)') or have_func('inet_aton("", (struct in_addr *)0)') +have_func('getservbyport(0, "")') have_header("arpa/nameser.h") have_header("resolv.h") @@ -482,8 +482,8 @@ $distcleanfiles << "constants.h" << "constdefs.*" if have_func(test_func) have_func("hsterror") have_func("getipnodebyname") or have_func("gethostbyname2") - have_func("socketpair") unless $defs.include?("-DHAVE_SOCKETPAIR") - unless have_func("gethostname") + have_func("socketpair(0, 0, 0, 0)") + unless have_func("gethostname((char *)0, 0)") have_func("uname") end if enable_config("socks", ENV["SOCKS_SERVER"]) -- cgit v1.2.3