From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Fix compilation using mingw.org's MinGW
Date: Sun, 28 Apr 2019 14:33:00 -0000 [thread overview]
Message-ID: <831s1murm2.fsf@gnu.org> (raw)
In-Reply-To: <93ccb0fa-8a05-60ff-d1a8-85d5663b8d16@redhat.com> (message from Pedro Alves on Fri, 19 Apr 2019 12:33:37 +0100)
> Cc: gdb-patches@sourceware.org
> From: Pedro Alves <palves@redhat.com>
> Date: Fri, 19 Apr 2019 12:33:37 +0100
>
> > I will try doing this in common-defs.h, but for the branch, we could
> > set _WIN32_WINNT only in windows-nat.c, as that's the only file that
> > currently cares, which should be safer. WDYT?
>
> Sounds good to me.
Below please find 2 patches: the first one for the 8.3 branch, the
second one for master. OK to commit (after writing ChangeLog
entries)?
--- gdb/windows-nat.c~0 2019-03-27 00:52:05.000000000 +0200
+++ gdb/windows-nat.c 2019-04-28 11:00:38.415049400 +0300
@@ -34,6 +34,15 @@
#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>
--- gdb/common/common-defs.h~0 2019-03-27 00:52:05.000000000 +0200
+++ gdb/common/common-defs.h 2019-04-28 11:26:11.785455800 +0300
@@ -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. */
+#ifdef __MINGW32__
+# ifdef _WIN32_WINNT
+# if _WIN32_WINNT < 0x0501
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x0501
+# endif
+# else
+# define _WIN32_WINNT 0x0501
+# endif
+#endif /* __MINGW32__ */
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
next prev parent reply other threads:[~2019-04-28 14:33 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-18 15:36 Eli Zaretskii
2019-04-18 17:01 ` Kevin Buettner
2019-04-18 18:54 ` Eli Zaretskii
2019-04-18 20:38 ` Kevin Buettner
2019-04-19 6:19 ` Eli Zaretskii
2019-04-18 17:20 ` Pedro Alves
2019-04-18 17:22 ` Pedro Alves
2019-04-18 18:57 ` Eli Zaretskii
2019-04-19 10:51 ` Pedro Alves
2019-04-19 11:23 ` Eli Zaretskii
2019-04-19 11:33 ` Pedro Alves
2019-04-28 14:33 ` Eli Zaretskii [this message]
2019-04-30 12:56 ` Pedro Alves
2019-04-30 13:06 ` LRN
2019-04-30 15:25 ` Eli Zaretskii
2019-04-30 17:04 ` Pedro Alves
2019-04-30 17:17 ` Eli Zaretskii
2019-04-30 17:26 ` Pedro Alves
2019-04-30 17:40 ` Eli Zaretskii
2019-04-30 17:58 ` Pedro Alves
[not found] ` <83o94nqr4g.fsf@gnu.org>
2019-04-30 18:38 ` Pedro Alves
2019-04-30 17:50 ` LRN
2019-04-30 13:10 ` Pedro Alves
2019-04-30 15:23 ` Eli Zaretskii
2019-04-30 16:31 ` Pedro Alves
2019-05-03 8:04 ` Eli Zaretskii
2019-05-03 8:26 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=831s1murm2.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox