summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-06 10:30:00 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-06 10:30:00 +0000
commit693ffb3397392d8c19c5279d3ffd35cc73e29343 (patch)
treef34b43d69ca84f684da325aee292e849795849ac
parent0b2eedb260e38d8036e4cfa0790faf43a0ca6147 (diff)
* ext/socket/{getaddrinfo,getnameinfo}.c: include winsock2.h only when
specified to use winsock2 by user. this problem is reported by kosaki. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/socket/getaddrinfo.c4
-rw-r--r--ext/socket/getnameinfo.c4
3 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ef80c0fda..48ad4dc6d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jan 6 19:28:36 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/{getaddrinfo,getnameinfo}.c: include winsock2.h only when
+ specified to use winsock2 by user.
+ this problem is reported by kosaki.
+
Thu Jan 6 18:12:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/README.win32: fix the misunderstanding of previous commit.
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 15459cf013..1a53226791 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -71,7 +71,11 @@
#include <in.h>
#include <netdb.h>
#else
+#if USE_WINSOCK2
#include <winsock2.h>
+#else
+#include <winsock.h>
+#endif
#include <io.h>
#endif
#include <string.h>
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 32b717713a..1ad85e3fbb 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -56,7 +56,11 @@
#endif
#endif
#ifdef _WIN32
+#if USE_WINSOCK2
#include <winsock2.h>
+#else
+#include <winsock.h>
+#endif
#define snprintf _snprintf
#endif