summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/extconf.rb2
-rw-r--r--ext/socket/socket.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 4c7d32af3b..28f38140b4 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -4,11 +4,9 @@ case RUBY_PLATFORM
when /bccwin32/
test_func = "WSACleanup"
have_library("ws2_32", "WSACleanup")
- have_func("closesocket")
when /mswin32|mingw/
test_func = "WSACleanup"
have_library("wsock32", "WSACleanup")
- have_func("closesocket")
when /cygwin/
test_func = "socket"
when /beos/
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 7c6610c144..68ceb284fe 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -197,6 +197,11 @@ ruby_getaddrinfo__aix(nodename, servname, hints, res)
#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo__aix((node),(serv),(hints),(res))
#endif
+#ifdef HAVE_CLOSESOCKET
+#undef close
+#define close closesocket
+#endif
+
static VALUE
init_sock(sock, fd)
VALUE sock;