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 SYN_IE(a) a(..)
114 # define EXP_MODULE(a) a..
115 # define IMPORT_DELOOPER(mod) import mod
116 # define IMPORT_1_3(mod) {--}
117 # define IMP_FASTSTRING() import FastString
118 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
119 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
121 # define CCALL_THEN thenPrimIO
122 # define MkIOError(h,errt,msg) (errt msg)
125 #if __GLASGOW_HASKELL__ >= 26 && __GLASGOW_HASKELL__ < 200
135 #if defined(__GLASGOW_HASKELL__)
136 #define FAST_INT Int#
138 #define IBOX(x) (I# (x))
139 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201
140 #define _ADD_ `plusInt#`
141 #define _SUB_ `minusInt#`
142 #define _MUL_ `timesInt#`
143 #define _DIV_ `divInt#`
144 #define _QUOT_ `quotInt#`
145 #define _NEG_ negateInt#
146 #define _EQ_ `eqInt#`
147 #define _LT_ `ltInt#`
148 #define _LE_ `leInt#`
149 #define _GE_ `geInt#`
150 #define _GT_ `gtInt#`
156 #define _QUOT_ `quotInt#`
157 #define _NEG_ negateInt#
165 #define FAST_BOOL Int#
168 #define _IS_TRUE_(x) ((x) _EQ_ 1#)
170 #else {- ! __GLASGOW_HASKELL__ -}
179 #define _QUOT_ `quot`
187 #define FAST_BOOL Bool
189 #define _FALSE_ False
190 #define _IS_TRUE_(x) (x)
192 #endif {- ! __GLASGOW_HASKELL__ -}
194 #if __GLASGOW_HASKELL__ >= 23
195 # define USE_FAST_STRINGS 1
196 # if __GLASGOW_HASKELL__ < 200 || __GLASGOW_HASKELL__ >= 202
197 # define FAST_STRING FastString {-_PackedString -}
198 # if __GLASGOW_HASKELL__ < 200
199 # define SLIT(x) (mkFastCharString (A# (x#)))
200 # elif __GLASGOW_HASKELL__ < 209
201 # define SLIT(x) (mkFastCharString (GlaExts.A# (x#)))
203 # define SLIT(x) (mkFastCharString (Addr.A# (x#)))
205 # define _CMP_STRING_ cmpPString
206 /* cmpPString defined in utils/Util.lhs */
207 # define _NULL_ nullFastString {-_nullPS-}
208 # define _NIL_ (mkFastString "") {-_nilPS -}
209 # define _CONS_ consFS {-_consPS-}
210 # define _HEAD_ headFS {-_headPS-}
211 # define _TAIL_ tailFS {-_tailPS-}
212 # define _LENGTH_ lengthFS {-_lengthPS-}
213 # define _PK_ mkFastString {-_packString-}
214 # define _UNPK_ unpackFS {-_unpackPS-}
215 /* # define _SUBSTR_ _substrPS */
216 # define _APPEND_ `appendFS` {-`_appendPS`-}
217 # define _CONCAT_ concatFS {-_concatPS-}
219 # define FAST_STRING GHCbase.PackedString
220 # define SLIT(x) (packCString (GHCbase.A# x#))
221 # define _CMP_STRING_ cmpPString
222 # define _NULL_ nullPS
224 # define _CONS_ consPS
225 # define _HEAD_ headPS
226 # define _TAIL_ tailPS
227 # define _LENGTH_ lengthPS
228 # define _PK_ packString
229 # define _UNPK_ unpackPS
230 # define _SUBSTR_ substrPS
231 # define _APPEND_ `appendPS`
232 # define _CONCAT_ concatPS
235 # define FAST_STRING String
237 # define _CMP_STRING_ cmpString
243 # define _LENGTH_ length
244 # define _PK_ (\x->x)
245 # define _UNPK_ (\x->x)
246 # define _SUBSTR_ substr{-from Utils-}
248 # define _CONCAT_ concat