aboutsummaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-05-03 10:55:33 +0300
committerEli Zaretskii <eliz@gnu.org>2019-05-03 10:55:33 +0300
commit353ea2d106a51cfd1680f7d351f35eb8f69c9248 (patch)
tree6b19d34d8d6f08ce90ed53a913e04a1859a06022 /gdb/common
parent5f2459c233faebe8f882e556b2f4a86594a51292 (diff)
downloadgdb-353ea2d106a51cfd1680f7d351f35eb8f69c9248.zip
gdb-353ea2d106a51cfd1680f7d351f35eb8f69c9248.tar.gz
gdb-353ea2d106a51cfd1680f7d351f35eb8f69c9248.tar.bz2
On MS-Windows, define _WIN32_WINNT in a single common place.
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.
Diffstat (limited to 'gdb/common')
-rw-r--r--gdb/common/common-defs.h14
-rw-r--r--gdb/common/netstuff.c4
2 files changed, 14 insertions, 4 deletions
diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
index 6b1f004..8c16492 100644
--- a/gdb/common/common-defs.h
+++ b/gdb/common/common-defs.h
@@ -72,6 +72,20 @@
#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>
diff --git a/gdb/common/netstuff.c b/gdb/common/netstuff.c
index 27fdc73..b192de7 100644
--- a/gdb/common/netstuff.c
+++ b/gdb/common/netstuff.c
@@ -21,10 +21,6 @@
#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>