diff options
author | Ben.Lippmeier@anu.edu.au <unknown> | 2009-11-18 11:05:48 +0000 |
---|---|---|
committer | Ben.Lippmeier@anu.edu.au <unknown> | 2009-11-18 11:05:48 +0000 |
commit | 5e4597f7ab70895496a26c30aadf11353c3928d2 (patch) | |
tree | 80794a9fa04fe0b10af36eebffc47b37eb7e6065 /includes/RtsAPI.h | |
parent | a8d8c534d5363c865ee2c4948ccd52a64a62c55f (diff) | |
download | haskell-5e4597f7ab70895496a26c30aadf11353c3928d2.tar.gz |
Windows DLLs: Don't rely on stg/DLL.h being included in RtsAPI.h
Diffstat (limited to 'includes/RtsAPI.h')
-rw-r--r-- | includes/RtsAPI.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h index 03dbce22a5..a4d210aab8 100644 --- a/includes/RtsAPI.h +++ b/includes/RtsAPI.h @@ -162,13 +162,19 @@ rts_getSchedStatus (Capability *cap); These are used by foreign export and foreign import "wrapper" stubs. ----------------------------------------------------------------------- */ -// When producing Windows DLLs the compiler needs to know which symbols -// are in the local package/DLL vs external ones. -// DLL_IMPORT_BASE expands to __declspec(dllimport) when we're not compiling -// the the base package. - -DLL_IMPORT_BASE extern StgWord base_GHCziTopHandler_runIO_closure[]; -DLL_IMPORT_BASE extern StgWord base_GHCziTopHandler_runNonIO_closure[]; +// When producing Windows DLLs the we need to know which symbols are in the +// local package/DLL vs external ones. +// +// Note that RtsAPI.h is also included by foreign export stubs in +// the base package itself. +// +#if defined(mingw32_TARGET_OS) && defined(__PIC__) && !defined(COMPILING_BASE_PACKAGE) +__declspec(dllimport) extern StgWord base_GHCziTopHandler_runIO_closure[]; +__declspec(dllimport) extern StgWord base_GHCziTopHandler_runNonIO_closure[]; +#else +extern StgWord base_GHCziTopHandler_runIO_closure[]; +extern StgWord base_GHCziTopHandler_runNonIO_closure[]; +#endif #define runIO_closure base_GHCziTopHandler_runIO_closure #define runNonIO_closure base_GHCziTopHandler_runNonIO_closure |