summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/Rts.h6
-rw-r--r--includes/stg/Types.h9
2 files changed, 14 insertions, 1 deletions
diff --git a/includes/Rts.h b/includes/Rts.h
index dd60726c39..256a3e586c 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -16,6 +16,12 @@
extern "C" {
#endif
+/* get types from GHC's runtime system */
+#include "ghcconfig.h"
+/* We have to include Types.h before everything else as this defines some
+ macros that will change the behaviour of system headers. */
+#include "stg/Types.h"
+
/* We include windows.h very early, as on Win64 the CONTEXT type has
fields "R8", "R9" and "R10", which goes bad if we've already
#define'd those names for our own purposes (in stg/Regs.h) */
diff --git a/includes/stg/Types.h b/includes/stg/Types.h
index f270686ebc..08ba58c799 100644
--- a/includes/stg/Types.h
+++ b/includes/stg/Types.h
@@ -21,8 +21,15 @@
#pragma once
#if defined(mingw32_HOST_OS)
+# if defined(__USE_MINGW_ANSI_STDIO)
+# if __USE_MINGW_ANSI_STDIO != 1
+# warning "Mismatch between __USE_MINGW_ANSI_STDIO definitions. \
+If using Rts.h make sure it is the first header included."
+# endif
+# else
/* Inform mingw we want the ISO rather than Windows printf format specifiers. */
-#define __USE_MINGW_ANSI_STDIO 1
+# define __USE_MINGW_ANSI_STDIO 1
+#endif
#endif
/* ISO C 99 says: