summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-03 22:24:57 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-03 22:24:57 +0000
commitda39199964fe8d8e87ac94c737376835f3cec2d1 (patch)
tree927121e255b5de76647178a547dbf940a7793c6a /ext/socket/extconf.rb
parenta8f95d6646c11bdf5bfead14af3c5122c83449aa (diff)
* ext/socket/extconf.rb: Specify arguments to test functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb49
1 files changed, 26 insertions, 23 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index b25775c..1e0a3fd 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -67,31 +67,32 @@ when /(ms|bcc)win(32|64)|mingw/
test_func = "WSACleanup"
have_library("ws2_32", "WSACleanup", headers)
when /cygwin/
- test_func = "socket"
+ test_func = "socket(0,0,0)"
when /beos/
- test_func = "socket"
- have_library("net", "socket", headers)
+ test_func = "socket(0,0,0)"
+ have_library("net", "socket(0,0,0)", headers)
when /haiku/
- test_func = "socket"
- have_library("network", "socket", headers)
+ test_func = "socket(0,0,0)"
+ have_library("network", "socket(0,0,0)", headers)
when /i386-os2_emx/
- test_func = "socket"
- have_library("socket", "socket", headers)
+ test_func = "socket(0,0,0)"
+ have_library("socket", "socket(0,0,0)", headers)
else
- test_func = "socket"
- have_library("nsl", "t_open", headers) # SunOS
- have_library("socket", "socket", headers) # SunOS
+ test_func = "socket(0,0,0)"
+ have_library("nsl", 't_open("", 0, (struct t_info *)NULL)', headers) # SunOS
+ have_library("socket", "socket(0,0,0)", headers) # SunOS
end
if have_func(test_func, headers)
- have_func("sendmsg", headers)
- have_func("recvmsg", headers)
+ have_func("sendmsg(0, (struct msghdr *)NULL, 0)", headers) # POSIX
+ have_func("recvmsg(0, (struct msghdr *)NULL, 0)", headers) # POSIX
- have_func("freehostent", headers)
- have_func("freeaddrinfo", headers)
+ have_func("freehostent((struct hostent *)NULL)", headers) # RFC 2553
+ have_func("freeaddrinfo((struct addrinfo *)NULL)", headers) # RFC 2553
- if /haiku/ !~ RUBY_PLATFORM and have_func("gai_strerror", headers)
+ if /haiku/ !~ RUBY_PLATFORM and
+ have_func("gai_strerror(0)", headers) # POSIX
if checking_for("gai_strerror() returns const pointer") {!try_compile(<<EOF)}
#{cpp_include(headers)}
#include <stdlib.h>
@@ -109,25 +110,27 @@ EOF
have_func('inet_ntop(0, (const void *)0, (char *)0, 0)', headers) or
have_func("inet_ntoa(*(struct in_addr *)NULL)", headers)
- have_func('inet_pton(0, "", (void *)0)', headers) or have_func('inet_aton("", (struct in_addr *)0)', headers)
+ have_func('inet_pton(0, "", (void *)0)', headers) or
+ have_func('inet_aton("", (struct in_addr *)0)', headers)
have_func('getservbyport(0, "")', headers)
- have_func("getifaddrs", headers)
+ have_func("getifaddrs((struct ifaddrs **)NULL)", headers)
have_func("getpeereid", headers)
- have_func("getpeerucred", headers)
+ have_func("getpeerucred(0, (ucred_t **)NULL)", headers) # SunOS
- have_func("if_indextoname", headers)
+ have_func('if_indextoname(0, "")', headers)
have_func("hsterror", headers)
- have_func("getipnodebyname", headers)
- have_func("gethostbyname2", headers)
- if !have_func("socketpair(0, 0, 0, 0)", headers) and have_func("rb_w32_socketpair(0, 0, 0, 0)", headers)
+ have_func('getipnodebyname("", 0, 0, (int *)0)', headers) # RFC 2553
+ have_func('gethostbyname2("", 0)', headers) # RFC 2133
+ if !have_func("socketpair(0, 0, 0, 0)", headers) and
+ have_func("rb_w32_socketpair(0, 0, 0, 0)", headers)
$defs << "-Dsocketpair(a,b,c,d)=rb_w32_socketpair((a),(b),(c),(d))"
$defs << "-DHAVE_SOCKETPAIR"
end
unless have_func("gethostname((char *)0, 0)", headers)
- have_func("uname", headers)
+ have_func("uname((struct utsname *)NULL)", headers)
end
ipv6 = false