aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorOrgad Shaneh <orgads@gmail.com>2021-10-28 09:07:46 +0000
committerMike Frysinger <vapier@gentoo.org>2021-10-30 23:50:09 -0400
commit1352aabb238dc0f21097b753d6fdb931e533db41 (patch)
treeb0759c19c45b6089730fc2624cf73beb0c120768 /sim/ppc
parent590abc168fb25908cde1df89f4905b575c14e55d (diff)
downloadgdb-1352aabb238dc0f21097b753d6fdb931e533db41.zip
gdb-1352aabb238dc0f21097b753d6fdb931e533db41.tar.gz
gdb-1352aabb238dc0f21097b753d6fdb931e533db41.tar.bz2
sim: fix compilation on mingw64 [PR sim/28476]
...by reordering includes. 1. 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. ppc registers.h defines CR, which is used as a member in winnt.h. winsock2.h is included by sys/time.h, so sys/time.h has to be included before registers.h. Bug: https://sourceware.org/PR28476
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/emul_netbsd.c6
-rw-r--r--sim/ppc/emul_unix.c6
-rw-r--r--sim/ppc/mon.c9
3 files changed, 14 insertions, 7 deletions
diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c
index a97fc3b..d1595c5 100644
--- a/sim/ppc/emul_netbsd.c
+++ b/sim/ppc/emul_netbsd.c
@@ -25,8 +25,7 @@
/* Note: this module is called via a table. There is no benefit in
making it inline */
-#include "emul_generic.h"
-#include "emul_netbsd.h"
+#include "defs.h"
#include <string.h>
#include <sys/types.h>
@@ -38,6 +37,9 @@
#include <sys/param.h>
#include <sys/time.h>
+#include "emul_generic.h"
+#include "emul_netbsd.h"
+
#ifdef HAVE_GETRUSAGE
#ifndef HAVE_SYS_RESOURCE_H
#undef HAVE_GETRUSAGE
diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c
index cfcb469..191e26a 100644
--- a/sim/ppc/emul_unix.c
+++ b/sim/ppc/emul_unix.c
@@ -25,8 +25,7 @@
/* Note: this module is called via a table. There is no benefit in
making it inline */
-#include "emul_generic.h"
-#include "emul_unix.h"
+#include "defs.h"
#include <string.h>
#ifdef HAVE_SYS_TYPES_H
@@ -124,6 +123,9 @@ int getrusage();
#include <stdlib.h>
#include <time.h>
+#include "emul_generic.h"
+#include "emul_unix.h"
+
#ifndef STATIC_INLINE_EMUL_UNIX
#define STATIC_INLINE_EMUL_UNIX STATIC_INLINE
#endif
diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c
index 966f86c..4e29ec9 100644
--- a/sim/ppc/mon.c
+++ b/sim/ppc/mon.c
@@ -21,9 +21,8 @@
#ifndef _MON_C_
#define _MON_C_
-#include "basics.h"
-#include "cpu.h"
-#include "mon.h"
+#include "defs.h"
+
#include <stdio.h>
#include <string.h>
@@ -42,6 +41,10 @@
int getrusage();
#endif
+#include "basics.h"
+#include "cpu.h"
+#include "mon.h"
+
#define MAX_BYTE_READWRITE 9
#define MAX_SHIFT_READWRITE 3