summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/Rts.h7
-rw-r--r--rts/StgCRun.c8
-rw-r--r--rts/win32/ThrIOManager.c2
3 files changed, 16 insertions, 1 deletions
diff --git a/includes/Rts.h b/includes/Rts.h
index 3360eda323..cb23fd1083 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -17,6 +17,13 @@
extern "C" {
#endif
+/* 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) */
+#if defined(HAVE_WINDOWS_H)
+#include <windows.h>
+#endif
+
#ifndef IN_STG_CODE
#define IN_STG_CODE 0
#endif
diff --git a/rts/StgCRun.c b/rts/StgCRun.c
index 3654b3336a..f08e35dd11 100644
--- a/rts/StgCRun.c
+++ b/rts/StgCRun.c
@@ -33,6 +33,14 @@
/* include Stg.h first because we want real machine regs in here: we
* have to get the value of R1 back from Stg land to C land intact.
*/
+
+/* 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) */
+#if defined(HAVE_WINDOWS_H)
+#include <windows.h>
+#endif
+
#define IN_STGCRUN 1
#include "Stg.h"
#include "Rts.h"
diff --git a/rts/win32/ThrIOManager.c b/rts/win32/ThrIOManager.c
index bad621ced6..afcdc19d27 100644
--- a/rts/win32/ThrIOManager.c
+++ b/rts/win32/ThrIOManager.c
@@ -152,7 +152,7 @@ ioManagerStart (void)
Capability *cap;
if (io_manager_event == INVALID_HANDLE_VALUE) {
cap = rts_lock();
-#if defined(mingw32_HOST_OS) && defined(__PIC__)
+#if defined(mingw32_HOST_OS) && defined(i386_HOST_Arch) && defined(__PIC__)
rts_evalIO(&cap,_imp__base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
#else
rts_evalIO(&cap,&base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);