1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2009
5 * Support for Windows DLLs.
7 * Do not #include this file directly: #include "Rts.h" instead.
9 * To understand the structure of the RTS headers, see the wiki:
10 * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
12 * ---------------------------------------------------------------------------*/
15 #define __STGDLL_H__ 1
17 #if defined(__PIC__) && defined(mingw32_TARGET_OS)
18 # define DLL_IMPORT_DATA_REF(x) (_imp__##x)
19 # define DLL_IMPORT_DATA_VARNAME(x) *_imp__##x
20 # if __GNUC__ && !defined(__declspec)
23 # define DLLIMPORT __declspec(dllimport)
24 # define DLLIMPORT_DATA(x) _imp__##x
27 # define DLL_IMPORT_DATA_REF(x) (&(x))
28 # define DLL_IMPORT_DATA_VARNAME(x) x
32 /* The view of the ghc/includes/ header files differ ever so
33 slightly depending on whether the RTS is being compiled
34 or not - so we're forced to distinguish between two.
35 [oh, you want details :) : Data symbols defined by the RTS
36 have to be accessed through an extra level of indirection
37 when compiling generated .hc code compared to when the RTS
38 sources are being processed. This is only the case when
42 #define DLL_IMPORT DLLIMPORT
43 #define DLL_IMPORT_RTS
44 #define DLL_IMPORT_DATA_VAR(x) x
47 #define DLL_IMPORT_RTS DLLIMPORT
48 # if defined(__PIC__) && defined(mingw32_TARGET_OS)
49 # define DLL_IMPORT_DATA_VAR(x) _imp__##x
51 # define DLL_IMPORT_DATA_VAR(x) x
56 #ifdef COMPILING_STDLIB
57 #define DLL_IMPORT_STDLIB
59 #define DLL_IMPORT_STDLIB DLLIMPORT
62 #endif /* __STGDLL_H__ */