Commit f09812de authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix RTS DLL references on Win64

parent 5872bf59
...@@ -15,13 +15,22 @@ ...@@ -15,13 +15,22 @@
#define __STGDLL_H__ 1 #define __STGDLL_H__ 1
#if defined(COMPILING_WINDOWS_DLL) #if defined(COMPILING_WINDOWS_DLL)
# define DLL_IMPORT_DATA_REF(x) (_imp__##x) # if defined(x86_64_HOST_ARCH)
# define DLL_IMPORT_DATA_VARNAME(x) *_imp__##x # 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) # if __GNUC__ && !defined(__declspec)
# define DLLIMPORT # define DLLIMPORT
# else # else
# define DLLIMPORT __declspec(dllimport) # 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 # endif
#else #else
# define DLL_IMPORT_DATA_REF(x) (&(x)) # define DLL_IMPORT_DATA_REF(x) (&(x))
...@@ -46,7 +55,11 @@ ...@@ -46,7 +55,11 @@
#define DLL_IMPORT #define DLL_IMPORT
#define DLL_IMPORT_RTS DLLIMPORT #define DLL_IMPORT_RTS DLLIMPORT
# if defined(COMPILING_WINDOWS_DLL) # 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 # else
# define DLL_IMPORT_DATA_VAR(x) x # define DLL_IMPORT_DATA_VAR(x) x
# endif # endif
......
...@@ -1316,7 +1316,11 @@ typedef struct _RtsSymbolVal { ...@@ -1316,7 +1316,11 @@ typedef struct _RtsSymbolVal {
#define SymI_NeedsProto(vvv) extern void vvv(void); #define SymI_NeedsProto(vvv) extern void vvv(void);
#if defined(COMPILING_WINDOWS_DLL) #if defined(COMPILING_WINDOWS_DLL)
#define SymE_HasProto(vvv) SymE_HasProto(vvv); #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 #else
#define SymE_NeedsProto(vvv) SymI_NeedsProto(vvv); #define SymE_NeedsProto(vvv) SymI_NeedsProto(vvv);
#define SymE_HasProto(vvv) SymI_HasProto(vvv) #define SymE_HasProto(vvv) SymI_HasProto(vvv)
......
...@@ -153,7 +153,11 @@ ioManagerStart (void) ...@@ -153,7 +153,11 @@ ioManagerStart (void)
if (io_manager_event == INVALID_HANDLE_VALUE) { if (io_manager_event == INVALID_HANDLE_VALUE) {
cap = rts_lock(); cap = rts_lock();
#if defined(COMPILING_WINDOWS_DLL) #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); rts_evalIO(&cap,_imp__base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
# endif
#else #else
rts_evalIO(&cap,&base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL); rts_evalIO(&cap,&base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment