Cope with libraries in libraries/foo/bar rather than just libraries/foo
[ghc-hetmet.git] / includes / StgDLL.h
1 #ifndef __STGDLL_H__
2 #define __STGDLL_H__ 1
3
4 #if defined(__PIC__) && defined(mingw32_TARGET_OS)
5 #  define DLL_IMPORT_DATA_REF(x) (_imp__##x)
6 #  define DLL_IMPORT_DATA_VARNAME(x) *_imp__##x
7 #  if __GNUC__ && !defined(__declspec)
8 #    define DLLIMPORT
9 #  else
10 #    define DLLIMPORT __declspec(dllimport)
11 #    define DLLIMPORT_DATA(x) _imp__##x
12 #  endif
13 #else
14 #  define DLL_IMPORT_DATA_REF(x) (&(x))
15 #  define DLL_IMPORT_DATA_VARNAME(x) x
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 # if defined(__PIC__) && defined(mingw32_TARGET_OS)
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__ */