6 IMPORTANT! If you put extra tabs/spaces in these macro definitions,
7 you will screw up the layout where they are used in case expressions!
9 (This is cpp-dependent, of course)
16 #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
17 #define ASSERT2(e,msg) if (not (e)) then (assertPprPanic __FILE__ __LINE__ (msg)) else
20 #define ASSERT2(e,msg)
26 #define CAT2(a,b)a/**/b
29 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ == 201
30 # define REALLY_HASKELL_1_3
32 # define EXP_MODULE(a) module a
33 # define IMPORT_DELOOPER(mod) import mod
34 # define IMPORT_1_3(mod) import mod
35 # define _tagCmp compare
39 # define _Addr GHCbase.Addr
40 # define _ByteArray GHCbase.ByteArray
41 # define _MutableByteArray GHCbase.MutableByteArray
42 # define _MutableArray GHCbase.MutableArray
43 # define _RealWorld GHCbase.RealWorld
44 # define _ST GHCbase.ST
45 # define _ForeignObj GHCbase.ForeignObj
46 # define _runST STbase.runST
47 # define failWith fail
49 # define STATE_TOK(x) (S# x)
50 # define ST_RET(x,y) (x,y)
51 # define unsafePerformST(x) unsafePerformPrimIO (x)
52 # define ST_TO_PrimIO(x) x
53 # define MkIOError(h,errt,msg) (errt msg)
55 # define IMP_FASTSTRING()
56 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq); import qualified GHCbase
57 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq); import qualified GHCbase
58 # define minInt (minBound::Int)
59 # define maxInt (maxBound::Int)
60 #elif defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 202
61 # define REALLY_HASKELL_1_3
63 # define EXP_MODULE(a) module a
64 # define IMPORT_DELOOPER(mod) import mod
65 # define IMPORT_1_3(mod) import mod
66 # define _CMP_TAG Ordering
67 # define _tagCmp compare
71 # define _Addr GlaExts.Addr
72 # define _ByteArray GlaExts.ByteArray
73 # define _MutableByteArray GlaExts.MutableByteArray
74 # define _MutableArray GlaExts.MutableArray
75 # define _RealWorld GlaExts.RealWorld
76 # define _ST GlaExts.ST
77 # define _ForeignObj Foreign.ForeignObj
78 # define _runST ST.runST
79 # define seqStrictlyST seqST
80 # define thenStrictlyST thenST
81 # define returnStrictlyST return
82 # define _readHandle IOHandle.readHandle
83 # define _writeHandle IOHandle.writeHandle
84 # define _newHandle IOHandle.newdHandle
86 # if __GLASGOW_HASKELL__ >= 209
87 # define STATE_TOK(x) x
88 # define ST_RET(x,y) STret (y) (x)
89 # define unsafePerformST(x) runST (x)
90 # define ST_TO_PrimIO(x) (stToIO (x))
92 # define STATE_TOK(x) (S# x)
93 # define ST_RET(x,y) (x,y)
94 # define unsafePerformST(x) unsafePerformPrimIO(x)
95 # define ST_TO_PrimIO(x) x
97 # define failWith fail
98 # define MkIOError(h,errt,msg) (IOError (Just h) errt msg)
99 # define CCALL_THEN thenIO_Prim
100 # define _filePtr IOHandle.filePtr
102 # define IMP_FASTSTRING() import FastString
103 # if __GLASGOW_HASKELL__ >= 209
104 # define IMP_Ubiq() import GlaExts ; import Addr(Addr(..)); import FastString
105 # define CHK_Ubiq() import GlaExts ; import Addr(Addr(..)); import FastString
107 # define IMP_Ubiq() import GlaExts ; import FastString
108 # define CHK_Ubiq() import GlaExts ; import FastString
110 # define minInt (minBound::Int)
111 # define maxInt (maxBound::Int)
113 # define STATE_TOK(x) (S# x)
114 # define ST_RET(x,y) (x,y)
115 # define unsafePerformST(x) unsafePerformPrimIO(x)
116 # define ST_TO_PrimIO(x) x
117 # define SYN_IE(a) a(..)
118 # define EXP_MODULE(a) a..
119 # define IMPORT_DELOOPER(mod) import mod
120 # define IMPORT_1_3(mod) {--}
121 # define IMP_FASTSTRING() import FastString
122 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
123 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
125 # define CCALL_THEN thenPrimIO
126 # define MkIOError(h,errt,msg) (errt msg)
129 #if __GLASGOW_HASKELL__ >= 26 && __GLASGOW_HASKELL__ < 200
139 #if defined(__GLASGOW_HASKELL__)
140 #define FAST_INT Int#
142 #define IBOX(x) (I# (x))
143 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201
144 #define _ADD_ `plusInt#`
145 #define _SUB_ `minusInt#`
146 #define _MUL_ `timesInt#`
147 #define _DIV_ `divInt#`
148 #define _QUOT_ `quotInt#`
149 #define _NEG_ negateInt#
150 #define _EQ_ `eqInt#`
151 #define _LT_ `ltInt#`
152 #define _LE_ `leInt#`
153 #define _GE_ `geInt#`
154 #define _GT_ `gtInt#`
160 #define _QUOT_ `quotInt#`
161 #define _NEG_ negateInt#
169 #define FAST_BOOL Int#
172 #define _IS_TRUE_(x) ((x) _EQ_ 1#)
174 #else {- ! __GLASGOW_HASKELL__ -}
183 #define _QUOT_ `quot`
191 #define FAST_BOOL Bool
193 #define _FALSE_ False
194 #define _IS_TRUE_(x) (x)
196 #endif {- ! __GLASGOW_HASKELL__ -}
198 #if __GLASGOW_HASKELL__ >= 23
199 # define USE_FAST_STRINGS 1
200 # if __GLASGOW_HASKELL__ < 200 || __GLASGOW_HASKELL__ >= 202
201 # define FAST_STRING FastString {-_PackedString -}
202 # if __GLASGOW_HASKELL__ < 200
203 # define SLIT(x) (mkFastCharString (A# (x#)))
204 # elif __GLASGOW_HASKELL__ < 209
205 # define SLIT(x) (mkFastCharString (GlaExts.A# (x#)))
207 # define SLIT(x) (mkFastCharString (Addr.A# (x#)))
209 # define _CMP_STRING_ cmpPString
210 /* cmpPString defined in utils/Util.lhs */
211 # define _NULL_ nullFastString {-_nullPS-}
212 # define _NIL_ (mkFastString "") {-_nilPS -}
213 # define _CONS_ consFS {-_consPS-}
214 # define _HEAD_ headFS {-_headPS-}
215 # define _TAIL_ tailFS {-_tailPS-}
216 # define _LENGTH_ lengthFS {-_lengthPS-}
217 # define _PK_ mkFastString {-_packString-}
218 # define _UNPK_ unpackFS {-_unpackPS-}
219 /* # define _SUBSTR_ _substrPS */
220 # define _APPEND_ `appendFS` {-`_appendPS`-}
221 # define _CONCAT_ concatFS {-_concatPS-}
223 # define FAST_STRING GHCbase.PackedString
224 # define SLIT(x) (packCString (GHCbase.A# x#))
225 # define _CMP_STRING_ cmpPString
226 # define _NULL_ nullPS
228 # define _CONS_ consPS
229 # define _HEAD_ headPS
230 # define _TAIL_ tailPS
231 # define _LENGTH_ lengthPS
232 # define _PK_ packString
233 # define _UNPK_ unpackPS
234 # define _SUBSTR_ substrPS
235 # define _APPEND_ `appendPS`
236 # define _CONCAT_ concatPS
239 # define FAST_STRING String
241 # define _CMP_STRING_ cmpString
247 # define _LENGTH_ length
248 # define _PK_ (\x->x)
249 # define _UNPK_ (\x->x)
250 # define _SUBSTR_ substr{-from Utils-}
252 # define _CONCAT_ concat