Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] sim: fix compilation on mingw64
@ 2021-10-27  6:27 Orgad Shaneh via Gdb-patches
  2021-10-27  9:33 ` Mike Frysinger via Gdb-patches
  2021-10-28  9:07 ` Orgad Shaneh via Gdb-patches
  0 siblings, 2 replies; 5+ messages in thread
From: Orgad Shaneh via Gdb-patches @ 2021-10-27  6:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Orgad Shaneh

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-29  5:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27  6:27 [PATCH] sim: fix compilation on mingw64 Orgad Shaneh via Gdb-patches
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox