[前][次][番号順一覧][スレッド一覧]

ruby-changes:39231

From: nobu <ko1@a...>
Date: Tue, 21 Jul 2015 19:51:29 +0900 (JST)
Subject: [ruby-changes:39231] nobu:r51312 (trunk): ruby/win32.h: include windows.h

nobu	2015-07-21 19:51:14 +0900 (Tue, 21 Jul 2015)

  New Revision: 51312

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51312

  Log:
    ruby/win32.h: include windows.h
    
    * include/ruby/win32.h: include windows.h before winsock2.h,
      because mswsock.h included by the former uses SOCKET defined
      after it in the latter.  fix a build failure with VC6.

  Modified files:
    trunk/ext/socket/getaddrinfo.c
    trunk/ext/socket/getnameinfo.c
    trunk/include/ruby/win32.h
Index: include/ruby/win32.h
===================================================================
--- include/ruby/win32.h	(revision 51311)
+++ include/ruby/win32.h	(revision 51312)
@@ -35,6 +35,9 @@ extern "C++" {			/* template without ext https://github.com/ruby/ruby/blob/trunk/include/ruby/win32.h#L35
 #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
Index: ext/socket/getaddrinfo.c
===================================================================
--- ext/socket/getaddrinfo.c	(revision 51311)
+++ ext/socket/getaddrinfo.c	(revision 51312)
@@ -66,6 +66,9 @@ https://github.com/ruby/ruby/blob/trunk/ext/socket/getaddrinfo.c#L66
 #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>
Index: ext/socket/getnameinfo.c
===================================================================
--- ext/socket/getnameinfo.c	(revision 51311)
+++ ext/socket/getnameinfo.c	(revision 51312)
@@ -59,6 +59,9 @@ https://github.com/ruby/ruby/blob/trunk/ext/socket/getnameinfo.c#L59
 #endif
 #endif
 #ifdef _WIN32
+#if defined(_MSC_VER) && _MSC_VER <= 1200
+#include <windows.h>
+#endif
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #define snprintf _snprintf

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]