On MS-Windows, define _WIN32_WINNT in a single common place.
authorEli Zaretskii <eliz@gnu.org>
Fri, 3 May 2019 07:55:33 +0000 (10:55 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 3 May 2019 07:55:33 +0000 (10:55 +0300)
This changeset defines _WIN32_WINNT to at least 0x0501, the level
of Windows XP, unless defined to a higher level, in a single
place.  It then removes all the overrides of _WIN32_WINNT in
individual files as no longer needed.  Doing this also solves
compilation of windows-nat.c with mingw.org's MinGW, as that
file uses CONSOLE_FONT_INFO which needs the XP level to become
exposed in the Windows headers, while mingw.org defaults to
Windows 9X.

gdb/ChangeLog:
2019-05-03  Eli Zaretskii  <eliz@gnu.org>

* common/common-defs.h [__MINGW32__ || __CYGWIN__]: Define
_WIN32_WINNT to the XP level, unless already defined to a higher
level.

* unittests/parse-connection-spec-selftests.c:
* ser-tcp.c:
* common/netstuff.c [USE_WIN32API]:  Remove the _WIN32_WINNT
override.

gdb/gdbserver/ChangeLog:
2019-05-03  Eli Zaretskii  <eliz@gnu.org>

* remote-utils.c:
* gdbreplay.c [USE_WIN32API]: Remove the _WIN32_WINNT override.

gdb/ChangeLog
gdb/common/common-defs.h
gdb/common/netstuff.c
gdb/gdbserver/ChangeLog
gdb/gdbserver/gdbreplay.c
gdb/gdbserver/remote-utils.c
gdb/ser-tcp.c
gdb/unittests/parse-connection-spec-selftests.c

index efe07afd82acc7070eaf1f9f2786ed094f32e022..4820ebfbf479cf9c049d5565ef6cdc640962525f 100644 (file)
@@ -1,5 +1,14 @@
 2019-05-03  Eli Zaretskii  <eliz@gnu.org>
 
+       * common/common-defs.h [__MINGW32__ || __CYGWIN__]: Define
+       _WIN32_WINNT to the XP level, unless already defined to a higher
+       level.
+
+       * unittests/parse-connection-spec-selftests.c:
+       * ser-tcp.c:
+       * common/netstuff.c [USE_WIN32API]:  Remove the _WIN32_WINNT
+       override.
+
        * symfile.c (find_separate_debug_file): Remove colon from the
        drive spec of DOS/Windows file names of the target, so that the
        file name produced from DEBUGDIR and the target's directory will
index 6b1f004ab1bd97f4fdbc4e3814e4a4d89c382f7b..8c164926db0fc21ff8f8add08bab1644e2898077 100644 (file)
 #define _FORTIFY_SOURCE 2
 #endif
 
+/* We don't support Windows versions before XP, so we define
+   _WIN32_WINNT correspondingly to ensure the Windows API headers
+   expose the required symbols.  */
+#if defined (__MINGW32__) || defined (__CYGWIN__)
+# ifdef _WIN32_WINNT
+#  if _WIN32_WINNT < 0x0501
+#   undef _WIN32_WINNT
+#   define _WIN32_WINNT 0x0501
+#  endif
+# else
+#  define _WIN32_WINNT 0x0501
+# endif
+#endif /* __MINGW32__ || __CYGWIN__ */
+
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
index 27fdc739ffd5a5e91b72acbd3f6caecf461e7c74..b192de7060f5bcd02ee36ef1f6fc89b416e4fcfa 100644 (file)
 #include <algorithm>
 
 #ifdef USE_WIN32API
-#if _WIN32_WINNT < 0x0501
-# undef _WIN32_WINNT
-# define _WIN32_WINNT 0x0501
-#endif
 #include <ws2tcpip.h>
 #else
 #include <netinet/in.h>
index 2985281518171c655a706c3469725dd8f868df7e..82278e7bb20e19b81b5f6c44ff90bb3740211616 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-03  Eli Zaretskii  <eliz@gnu.org>
+
+       * remote-utils.c:
+       * gdbreplay.c [USE_WIN32API]: Remove the _WIN32_WINNT override.
+
 2019-04-19  Tom Tromey  <tom@tromey.com>
 
        * server.c (struct vstop_notif): Derive from notif_event.
index ca0a9d31646fce414ee4a4c6140ebd0f69d66f11..2800e7834dfe50aa043a22809f055569afab1838 100644 (file)
 #endif
 
 #if USE_WIN32API
-#if _WIN32_WINNT < 0x0501
-# undef _WIN32_WINNT
-# define _WIN32_WINNT 0x0501
-#endif
 #include <ws2tcpip.h>
 #endif
 
index 903d77349d38f0d2f7b8f6e5a530a3990b1ad251..1d27ea31e2cfebf3eaf4932403a6f0f92845d9fd 100644 (file)
 #include <sys/stat.h>
 
 #if USE_WIN32API
-#if _WIN32_WINNT < 0x0501
-# undef _WIN32_WINNT
-# define _WIN32_WINNT 0x0501
-#endif
 #include <ws2tcpip.h>
 #endif
 
index 039b0432231142b6cc18138607858384727bd43b..927a28545700ce646d5a79453ebeb97088be69a6 100644 (file)
 #include "common/gdb_sys_time.h"
 
 #ifdef USE_WIN32API
-#if _WIN32_WINNT < 0x0501
-# undef _WIN32_WINNT
-# define _WIN32_WINNT 0x0501
-#endif
 #include <ws2tcpip.h>
 #ifndef ETIMEDOUT
 #define ETIMEDOUT WSAETIMEDOUT
index a4beb66e2c9dc342e3c06c9ccd12951d920d11e0..915aa669f428600c9ce4eb5204a1670ad0619e90 100644 (file)
 #include "common/netstuff.h"
 #include "diagnostics.h"
 #ifdef USE_WIN32API
-#if _WIN32_WINNT < 0x0501
-# undef _WIN32_WINNT
-# define _WIN32_WINNT 0x0501
-#endif
 #include <ws2tcpip.h>
 #else
 #include <netinet/in.h>
This page took 0.035355 seconds and 4 git commands to generate.