diff options
-rw-r--r-- | includes/stg/DLL.h | 21 | ||||
-rw-r--r-- | rts/Linker.c | 6 | ||||
-rw-r--r-- | rts/win32/ThrIOManager.c | 4 |
3 files changed, 26 insertions, 5 deletions
diff --git a/includes/stg/DLL.h b/includes/stg/DLL.h index ec64404e62..d23002afd8 100644 --- a/includes/stg/DLL.h +++ b/includes/stg/DLL.h @@ -15,13 +15,22 @@ #define __STGDLL_H__ 1 #if defined(COMPILING_WINDOWS_DLL) -# define DLL_IMPORT_DATA_REF(x) (_imp__##x) -# define DLL_IMPORT_DATA_VARNAME(x) *_imp__##x +# if defined(x86_64_HOST_ARCH) +# define DLL_IMPORT_DATA_REF(x) (__imp_##x) +# define DLL_IMPORT_DATA_VARNAME(x) *__imp_##x +# else +# define DLL_IMPORT_DATA_REF(x) (_imp__##x) +# define DLL_IMPORT_DATA_VARNAME(x) *_imp__##x +# endif # if __GNUC__ && !defined(__declspec) # define DLLIMPORT # else # define DLLIMPORT __declspec(dllimport) -# define DLLIMPORT_DATA(x) _imp__##x +# if defined(x86_64_HOST_ARCH) +# define DLLIMPORT_DATA(x) __imp_##x +# else +# define DLLIMPORT_DATA(x) _imp__##x +# endif # endif #else # define DLL_IMPORT_DATA_REF(x) (&(x)) @@ -46,7 +55,11 @@ #define DLL_IMPORT #define DLL_IMPORT_RTS DLLIMPORT # if defined(COMPILING_WINDOWS_DLL) -# define DLL_IMPORT_DATA_VAR(x) _imp__##x +# if defined(x86_64_HOST_ARCH) +# define DLL_IMPORT_DATA_VAR(x) __imp_##x +# else +# define DLL_IMPORT_DATA_VAR(x) _imp__##x +# endif # else # define DLL_IMPORT_DATA_VAR(x) x # endif diff --git a/rts/Linker.c b/rts/Linker.c index 26f734c758..2899ee1a29 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -1316,7 +1316,11 @@ typedef struct _RtsSymbolVal { #define SymI_NeedsProto(vvv) extern void vvv(void); #if defined(COMPILING_WINDOWS_DLL) #define SymE_HasProto(vvv) SymE_HasProto(vvv); -#define SymE_NeedsProto(vvv) extern void _imp__ ## vvv (void); +# if defined(x86_64_HOST_ARCH) +# define SymE_NeedsProto(vvv) extern void __imp_ ## vvv (void); +# else +# define SymE_NeedsProto(vvv) extern void _imp__ ## vvv (void); +# endif #else #define SymE_NeedsProto(vvv) SymI_NeedsProto(vvv); #define SymE_HasProto(vvv) SymI_HasProto(vvv) diff --git a/rts/win32/ThrIOManager.c b/rts/win32/ThrIOManager.c index 234d4dcfe4..41a1505de0 100644 --- a/rts/win32/ThrIOManager.c +++ b/rts/win32/ThrIOManager.c @@ -153,7 +153,11 @@ ioManagerStart (void) if (io_manager_event == INVALID_HANDLE_VALUE) {
cap = rts_lock();
#if defined(COMPILING_WINDOWS_DLL)
+# if defined(x86_64_HOST_ARCH)
+ rts_evalIO(&cap,__imp_base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
+# else
rts_evalIO(&cap,_imp__base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
+# endif
#else
rts_evalIO(&cap,&base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
#endif
|