Fixes for the threaded RTS on Win64
authorIan Lynagh <igloo@earth.li>
Sun, 18 Mar 2012 16:30:25 +0000 (16:30 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 18 Mar 2012 16:30:25 +0000 (16:30 +0000)
includes/Rts.h
rts/StgCRun.c
rts/win32/ThrIOManager.c

index 3360eda..cb23fd1 100644 (file)
 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
index 3654b33..f08e35d 100644 (file)
 /* 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"
index bad621c..afcdc19 100644 (file)
@@ -152,7 +152,7 @@ ioManagerStart (void)
     Capability *cap;\r
     if (io_manager_event == INVALID_HANDLE_VALUE) {\r
        cap = rts_lock();\r
-#if defined(mingw32_HOST_OS) && defined(__PIC__)\r
+#if defined(mingw32_HOST_OS) && defined(i386_HOST_Arch) && defined(__PIC__)\r
         rts_evalIO(&cap,_imp__base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);\r
 #else\r
         rts_evalIO(&cap,&base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);\r