Fix compilation with mingw.org's MinGW.
authorEli Zaretskii <eliz@gnu.org>
Fri, 3 May 2019 07:40:02 +0000 (10:40 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 3 May 2019 07:40:02 +0000 (10:40 +0300)
That flavor of MinGW assumes Windows 9X as the default target,
which doesn't expose CONSOLE_FONT_INFO stuff in Windows header
files.  Since we no longer support running on Windows older
than XP anyway, requiring it at build time makes sense.

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

* windows-nat.c [_WIN32_WINNT]: Define _WIN32_WINNT to Windows XP
level, so that various Windows header files expose the necessary
declarations and definitions.

gdb/ChangeLog
gdb/windows-nat.c

index e5dac9b..eb56ca0 100644 (file)
@@ -1,5 +1,9 @@
 2019-05-03  Eli Zaretskii  <eliz@gnu.org>
 
+       * windows-nat.c [_WIN32_WINNT]: Define _WIN32_WINNT to Windows XP
+       level, so that various Windows header files expose the necessary
+       declarations and definitions.
+
        * 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 a59c04e..3add8e6 100644 (file)
 #include <signal.h>
 #include <sys/types.h>
 #include <fcntl.h>
+/* We need at least the level of XP for CONSOLE_FONT_INFO.  */
+#ifdef _WIN32_WINNT
+# if _WIN32_WINNT < 0x0501
+#  undef _WIN32_WINNT
+#  define _WIN32_WINNT 0x0501
+# endif
+#else
+# define _WIN32_WINNT 0x0501
+#endif
 #include <windows.h>
 #include <imagehlp.h>
 #include <psapi.h>