This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix winsock2.h include order in ada/gsocket.h


Hi:

gcc/ada/gsocket.h includes windows.h before winsock2.h which leads to
clashing definitions with winsock.h included from within windows.h, at
least for mingw-w64. It is common practice to include winsock2.h before
windows.h, because winsock2.h always includes windows.h itself. The
trivial patch below fixes that. Please consider for applying to any
active branch if possible.

Regards.


2010-04-08  Ozkan Sezer  <sezeroz@gmail.com>

	* gsocket.h: Make sure that winsock2.h is included before windows.h


Index: gsocket.h
===================================================================
--- gsocket.h	(revision 158038)
+++ gsocket.h	(working copy)
@@ -72,7 +72,6 @@

 #elif defined (WINNT)
 #define FD_SETSIZE 1024
-#include <windows.h>

 #ifdef __MINGW32__
 #include <winsock2.h>
@@ -161,6 +160,8 @@

 #endif

+#include <windows.h>
+
 #elif defined(VMS)
 #define FD_SETSIZE 4096
 #ifndef IN_RTS

--
Ozkan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]