From: Orgad Shaneh via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Orgad Shaneh <orgads@gmail.com>
Subject: [PATCH] sim: fix compilation on mingw64
Date: Wed, 27 Oct 2021 06:27:03 +0000 [thread overview]
Message-ID: <20211027062703.3056254-1-orgads@gmail.com> (raw)
1. reorder includes in sim-utils.c.
sim/mips/sim-main.h defines UserMode, while there is a struct in winnt.h
which has UserMode as a member. So if sim-main.h is included before winnt.h,
compilation fails.
2. pre-include winsock2.h in ppc
registers.h defines CR, which is used as a member in winnt.h.
---
sim/common/sim-utils.c | 5 ++---
sim/ppc/defs.h | 3 +++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c
index 380afd0493f..8edd1c9dc0a 100644
--- a/sim/common/sim-utils.c
+++ b/sim/common/sim-utils.c
@@ -20,9 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This must come before any other includes. */
#include "defs.h"
-#include "sim-main.h"
-#include "sim-assert.h"
-
#include <stdlib.h>
#include <time.h>
#include <sys/time.h> /* needed by sys/resource.h */
@@ -34,7 +31,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "libiberty.h"
#include "bfd.h"
+#include "sim-main.h"
#include "sim-utils.h"
+#include "sim-assert.h"
/* Allocate zero filled memory with xcalloc - xcalloc aborts if the
allocation fails. */
diff --git a/sim/ppc/defs.h b/sim/ppc/defs.h
index c37f8c60485..31932b8b34d 100644
--- a/sim/ppc/defs.h
+++ b/sim/ppc/defs.h
@@ -22,6 +22,9 @@
/* Include gnulib's various configure tests. */
#include "gnulib/config.h"
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
/* Reset macros that our config.h will provide. */
#undef PACKAGE
--
2.33.1.windows.1
next reply other threads:[~2021-10-27 6:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-27 6:27 Orgad Shaneh via Gdb-patches [this message]
2021-10-27 9:33 ` Mike Frysinger via Gdb-patches
2021-10-28 9:07 ` Orgad Shaneh via Gdb-patches
2021-10-29 5:23 ` Mike Frysinger via Gdb-patches
2021-10-29 5:37 ` Orgad Shaneh via Gdb-patches
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=20211027062703.3056254-1-orgads@gmail.com \
--to=gdb-patches@sourceware.org \
--cc=orgads@gmail.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