...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
/* 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 */
#include "libiberty.h"
#include "bfd.h"
+#include "sim-main.h"
+#include "sim-assert.h"
#include "sim-utils.h"
/* Allocate zero filled memory with xcalloc - xcalloc aborts if the
/* 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>
#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
/* 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
#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
#ifndef _MON_C_
#define _MON_C_
-#include "basics.h"
-#include "cpu.h"
-#include "mon.h"
+#include "defs.h"
+
#include <stdio.h>
#include <string.h>
int getrusage();
#endif
+#include "basics.h"
+#include "cpu.h"
+#include "mon.h"
+
#define MAX_BYTE_READWRITE 9
#define MAX_SHIFT_READWRITE 3