summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/socket/getaddrinfo.c3
-rw-r--r--ext/socket/getnameinfo.c3
-rw-r--r--include/ruby/win32.h3
3 files changed, 9 insertions, 0 deletions
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 68f610e807f..6d6d11fa8fa 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -66,6 +66,9 @@
#endif
#include <unistd.h>
#else
+#if defined(_MSC_VER) && _MSC_VER <= 1200
+#include <windows.h>
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#include <io.h>
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 4da9680ccb0..d54a7c8c0d9 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -59,6 +59,9 @@
#endif
#endif
#ifdef _WIN32
+#if defined(_MSC_VER) && _MSC_VER <= 1200
+#include <windows.h>
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#define snprintf _snprintf
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index 9daea063238..7bf389d8e11 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -35,6 +35,9 @@ extern "C++" { /* template without extern "C++" */
#if !defined(_WIN64) && !defined(WIN32)
#define WIN32
#endif
+#if defined(_MSC_VER) && _MSC_VER <= 1200
+#include <windows.h>
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#if !defined(_MSC_VER) || _MSC_VER >= 1400