This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[RFA] Fix compilation of mingw64 with recent mingw64 header


Recent mingw64 header (at least on Cygwin)
have a macro definition for ETIMEDOUT inside include/errno.h

This leads to a warning and a compilation failure for the target.

This patch simply discard the value from errno.h,
but there would be another option consisting of 
using #ifndef ETIMEDOUT....

I have no idea if this would be preferable.
This is the reason why I didn't apply the obvious rule
for compilation failure.


Pierre Muller


2011-11-15  Pierre Muller  <muller@ics.u-strasbg.fr>

	* ser-tcp.c (USE_WIN32API ETIMEDOUT macro): Undefine first to
	avoid warning if already defined as in recent mingw64 errno header.

diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index e3d5640..a848e27 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -39,6 +39,7 @@
 
 #ifdef USE_WIN32API
 #include <winsock2.h>
+#undef ETIMEDOUT
 #define ETIMEDOUT WSAETIMEDOUT
 #define close(fd) closesocket (fd)
 #define ioctl ioctlsocket


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