[project @ 2000-03-14 09:55:05 by simonmar]
[ghc-hetmet.git] / ghc / rts / Prelude.h
1 /* -----------------------------------------------------------------------------
2  * $Id: Prelude.h,v 1.3 2000/03/14 09:55:05 simonmar Exp $
3  *
4  * (c) The GHC Team, 1998-2000
5  *
6  * Prelude identifiers that we sometimes need to refer to in the RTS.
7  *
8  * ---------------------------------------------------------------------------*/
9
10 #ifndef PRELUDE_H
11 #define PRELUDE_H
12
13 /* Define canonical names so we can abstract away from the actual
14  * module these names are defined in.
15  */
16
17 #ifndef INTERPRETER
18 extern DLL_IMPORT const StgClosure PrelBase_True_static_closure;
19 extern DLL_IMPORT const StgClosure PrelBase_False_static_closure;
20 extern DLL_IMPORT const StgClosure PrelPack_unpackCString_closure;
21 extern DLL_IMPORT const StgClosure PrelException_stackOverflow_closure;
22 extern DLL_IMPORT const StgClosure PrelException_heapOverflow_closure;
23 extern DLL_IMPORT const StgClosure PrelException_PutFullMVar_static_closure;
24 extern DLL_IMPORT const StgClosure PrelException_NonTermination_static_closure;
25 extern const StgClosure PrelMain_mainIO_closure;
26
27 extern DLL_IMPORT const StgInfoTable PrelBase_Czh_static_info;
28 extern DLL_IMPORT const StgInfoTable PrelBase_Izh_static_info;
29 extern DLL_IMPORT const StgInfoTable PrelFloat_Fzh_static_info;
30 extern DLL_IMPORT const StgInfoTable PrelFloat_Dzh_static_info;
31 extern DLL_IMPORT const StgInfoTable PrelAddr_Azh_static_info;
32 extern DLL_IMPORT const StgInfoTable PrelAddr_Wzh_static_info;
33 extern DLL_IMPORT const StgInfoTable PrelBase_Czh_con_info;
34 extern DLL_IMPORT const StgInfoTable PrelBase_Izh_con_info;
35 extern DLL_IMPORT const StgInfoTable PrelFloat_Fzh_con_info;
36 extern DLL_IMPORT const StgInfoTable PrelFloat_Dzh_con_info;
37 extern DLL_IMPORT const StgInfoTable PrelAddr_Azh_con_info;
38 extern DLL_IMPORT const StgInfoTable PrelAddr_Wzh_con_info;
39 extern DLL_IMPORT const StgInfoTable PrelAddr_I64zh_con_info;
40 extern DLL_IMPORT const StgInfoTable PrelAddr_W64zh_con_info;
41 extern DLL_IMPORT const StgInfoTable PrelStable_StablePtr_static_info;
42 extern DLL_IMPORT const StgInfoTable PrelStable_StablePtr_con_info;
43
44 #define True_closure           (&PrelBase_True_static_closure)
45 #define False_closure          (&PrelBase_False_static_closure)
46 #define stackOverflow_closure  (&PrelException_stackOverflow_closure)
47 #define heapOverflow_closure   (&PrelException_heapOverflow_closure)
48 #define PutFullMVar_closure    (&PrelException_PutFullMVar_static_closure)
49 #define NonTermination_closure (&PrelException_NonTermination_static_closure)
50 #define Czh_static_info        (&PrelBase_Czh_static_info)
51 #define Izh_static_info        (&PrelBase_Izh_static_info)
52 #define Fzh_static_info        (&PrelFloat_Fzh_static_info)
53 #define Dzh_static_info        (&PrelFloat_Dzh_static_info)
54 #define Azh_static_info        (&PrelAddr_Azh_static_info)
55 #define Wzh_static_info        (&PrelAddr_Wzh_static_info)
56 #define Czh_con_info           (&PrelBase_Czh_con_info)
57 #define Izh_con_info           (&PrelBase_Izh_con_info)
58 #define Fzh_con_info           (&PrelFloat_Fzh_con_info)
59 #define Dzh_con_info           (&PrelFloat_Dzh_con_info)
60 #define Azh_con_info           (&PrelAddr_Azh_con_info)
61 #define Wzh_con_info           (&PrelAddr_Wzh_con_info)
62 #define W64zh_con_info         (&PrelAddr_W64zh_con_info)
63 #define I64zh_con_info         (&PrelAddr_I64zh_con_info)
64 #define StablePtr_static_info  (&PrelStable_StablePtr_static_info)
65 #define StablePtr_con_info     (&PrelStable_StablePtr_con_info)
66 #define mainIO_closure         (&PrelMain_mainIO_closure)
67 #define unpackCString_closure  (&PrelPack_unpackCString_closure)
68
69 #else /* INTERPRETER */
70
71 /* We need indirections to the Prelude stuff, because we can't link
72  * these symbols statically.
73  */
74 extern const StgClosure *ind_True_static_closure;
75 extern const StgClosure *ind_False_static_closure;
76 extern const StgClosure *ind_unpackCString_closure;
77 extern const StgClosure *ind_stackOverflow_closure;
78 extern const StgClosure *ind_heapOverflow_closure;
79 extern const StgClosure *ind_PutFullMVar_static_closure;
80 extern const StgClosure *ind_NonTermination_static_closure;
81 extern const StgClosure *ind_mainIO_closure;
82
83 extern const StgInfoTable *ind_Czh_static_info;
84 extern const StgInfoTable *ind_Izh_static_info;
85 extern const StgInfoTable *ind_Fzh_static_info;
86 extern const StgInfoTable *ind_Dzh_static_info;
87 extern const StgInfoTable *ind_Azh_static_info;
88 extern const StgInfoTable *ind_Wzh_static_info;
89 extern const StgInfoTable *ind_Czh_con_info;
90 extern const StgInfoTable *ind_Izh_con_info;
91 extern const StgInfoTable *ind_Fzh_con_info;
92 extern const StgInfoTable *ind_Dzh_con_info;
93 extern const StgInfoTable *ind_Azh_con_info;
94 extern const StgInfoTable *ind_Wzh_con_info;
95 extern const StgInfoTable *ind_I64zh_con_info;
96 extern const StgInfoTable *ind_W64zh_con_info;
97 extern const StgInfoTable *ind_StablePtr_static_info;
98 extern const StgInfoTable *ind_StablePtr_con_info;
99
100 #define True_closure           ind_True_static_closure
101 #define False_closure          ind_False_static_closure
102 #define stackOverflow_closure  ind_stackOverflow_closure
103 #define heapOverflow_closure   ind_heapOverflow_closure
104 #define PutFullMVar_closure    ind_PutFullMVar_static_closure
105 #define NonTermination_closure ind_NonTermination_static_closure
106 #define Czh_static_info        ind_Czh_static_info
107 #define Izh_static_info        ind_Izh_static_info
108 #define Fzh_static_info        ind_Fzh_static_info
109 #define Dzh_static_info        ind_Dzh_static_info
110 #define Azh_static_info        ind_Azh_static_info
111 #define Wzh_static_info        ind_Wzh_static_info
112 #define Czh_con_info           ind_Czh_con_info
113 #define Izh_con_info           ind_Izh_con_info
114 #define Fzh_con_info           ind_Fzh_con_info
115 #define Dzh_con_info           ind_Dzh_con_info
116 #define Azh_con_info           ind_Azh_con_info
117 #define Wzh_con_info           ind_Wzh_con_info
118 #define W64zh_con_info         ind_W64zh_con_info
119 #define I64zh_con_info         ind_I64zh_con_info
120 #define StablePtr_static_info  ind_StablePtr_static_info
121 #define StablePtr_con_info     ind_StablePtr_con_info
122 #define mainIO_closure         ind_mainIO_closure
123 #define unpackCString_closure  ind_unpackCString_closure
124
125 #endif
126
127 void fixupPreludeRefs(void);
128
129 #endif /* PRELUDE_H */