Add Coercion.lhs
[ghc-hetmet.git] / includes / StgDLL.h
1 #ifndef __STGDLL_H__
2 #define __STGDLL_H__ 1
3
4 #if defined(HAVE_WIN32_DLL_SUPPORT) && !defined(DONT_WANT_WIN32_DLL_SUPPORT)
5 #define ENABLE_WIN32_DLL_SUPPORT
6 #endif
7
8 #ifdef ENABLE_WIN32_DLL_SUPPORT
9 # if __GNUC__ && !defined(__declspec)
10 #  define DLLIMPORT
11 # else
12 #  define DLLIMPORT __declspec(dllimport)
13 #  define DLLIMPORT_DATA(x) _imp__##x
14 # endif
15 #else
16 # define DLLIMPORT
17 #endif
18
19 /* The view of the ghc/includes/ header files differ ever so
20    slightly depending on whether the RTS is being compiled
21    or not - so we're forced to distinguish between two.
22    [oh, you want details :) : Data symbols defined by the RTS
23     have to be accessed through an extra level of indirection
24     when compiling generated .hc code compared to when the RTS
25     sources are being processed. This is only the case when 
26     using Win32 DLLs. ]
27 */
28 #ifdef COMPILING_RTS
29 #define DLL_IMPORT DLLIMPORT
30 #define DLL_IMPORT_RTS
31 #define DLL_IMPORT_DATA_VAR(x) x
32 #else
33 #define DLL_IMPORT
34 #define DLL_IMPORT_RTS DLLIMPORT
35 # ifdef ENABLE_WIN32_DLL_SUPPORT
36 #  define DLL_IMPORT_DATA_VAR(x) _imp__##x
37 # else
38 #  define DLL_IMPORT_DATA_VAR(x) x
39 # endif
40 #endif
41
42 #ifdef COMPILING_STDLIB
43 #define DLL_IMPORT_STDLIB
44 #else
45 #define DLL_IMPORT_STDLIB DLLIMPORT
46 #endif
47
48 #endif /* __STGDLL_H__ */