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 MkIOError(h,errt,msg) (errt msg)
51 # define IMP_FASTSTRING()
52 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq); import qualified GHCbase
53 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq); import qualified GHCbase
54 # define minInt (minBound::Int)
55 # define maxInt (maxBound::Int)
56 #elif defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 202
57 # define REALLY_HASKELL_1_3
59 # define EXP_MODULE(a) module a
60 # define IMPORT_DELOOPER(mod) import mod
61 # define IMPORT_1_3(mod) import mod
62 # define _CMP_TAG Ordering
63 # define _tagCmp compare
67 # define _Addr GlaExts.Addr
68 # define _ByteArray GlaExts.ByteArray
69 # define _MutableByteArray GlaExts.MutableByteArray
70 # define _MutableArray GlaExts.MutableArray
71 # define _RealWorld GlaExts.RealWorld
72 # define _ST GlaExts.ST
73 # define _ForeignObj Foreign.ForeignObj
74 # define _runST ST.runST
75 # define seqStrictlyST seqST
76 # define thenStrictlyST thenST
77 # define returnStrictlyST return
78 # define _readHandle IOHandle.readHandle
79 # define _writeHandle IOHandle.writeHandle
80 # define _newHandle IOHandle.newdHandle
82 # define failWith fail
83 # define MkIOError(h,errt,msg) (IOError (Just h) errt msg)
84 # define CCALL_THEN thenIO_Prim
85 # define _filePtr IOHandle.filePtr
87 # define IMP_FASTSTRING() import FastString
88 # define IMP_Ubiq() import GlaExts ; import FastString
89 # define CHK_Ubiq() import GlaExts ; import FastString
90 # define minInt (minBound::Int)
91 # define maxInt (maxBound::Int)
93 # define SYN_IE(a) a(..)
94 # define EXP_MODULE(a) a..
95 # define IMPORT_DELOOPER(mod) import mod
96 # define IMPORT_1_3(mod) {--}
97 # define IMP_FASTSTRING() import FastString
98 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
99 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
101 # define CCALL_THEN thenPrimIO
102 # define MkIOError(h,errt,msg) (errt msg)
105 #if __GLASGOW_HASKELL__ >= 26 && __GLASGOW_HASKELL__ < 200
115 #if defined(__GLASGOW_HASKELL__)
116 #define FAST_INT Int#
118 #define IBOX(x) (I# (x))
119 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201
120 #define _ADD_ `plusInt#`
121 #define _SUB_ `minusInt#`
122 #define _MUL_ `timesInt#`
123 #define _DIV_ `divInt#`
124 #define _QUOT_ `quotInt#`
125 #define _NEG_ negateInt#
126 #define _EQ_ `eqInt#`
127 #define _LT_ `ltInt#`
128 #define _LE_ `leInt#`
129 #define _GE_ `geInt#`
130 #define _GT_ `gtInt#`
136 #define _QUOT_ `quotInt#`
137 #define _NEG_ negateInt#
145 #define FAST_BOOL Int#
148 #define _IS_TRUE_(x) ((x) _EQ_ 1#)
150 #else {- ! __GLASGOW_HASKELL__ -}
159 #define _QUOT_ `quot`
167 #define FAST_BOOL Bool
169 #define _FALSE_ False
170 #define _IS_TRUE_(x) (x)
172 #endif {- ! __GLASGOW_HASKELL__ -}
174 #if __GLASGOW_HASKELL__ >= 23
175 # define USE_FAST_STRINGS 1
176 # if __GLASGOW_HASKELL__ < 200 || __GLASGOW_HASKELL__ >= 202
177 # define FAST_STRING FastString {-_PackedString -}
178 # if __GLASGOW_HASKELL__ < 200
179 # define SLIT(x) (mkFastCharString (A# (x#)))
181 # define SLIT(x) (mkFastCharString (GlaExts.A# (x#)))
183 # define _CMP_STRING_ cmpPString
184 /* cmpPString defined in utils/Util.lhs */
185 # define _NULL_ nullFastString {-_nullPS-}
186 # define _NIL_ (mkFastString "") {-_nilPS -}
187 # define _CONS_ consFS {-_consPS-}
188 # define _HEAD_ headFS {-_headPS-}
189 # define _TAIL_ tailFS {-_tailPS-}
190 # define _LENGTH_ lengthFS {-_lengthPS-}
191 # define _PK_ mkFastString {-_packString-}
192 # define _UNPK_ unpackFS {-_unpackPS-}
193 /* # define _SUBSTR_ _substrPS */
194 # define _APPEND_ `appendFS` {-`_appendPS`-}
195 # define _CONCAT_ concatFS {-_concatPS-}
197 # define FAST_STRING GHCbase.PackedString
198 # define SLIT(x) (packCString (GHCbase.A# x#))
199 # define _CMP_STRING_ cmpPString
200 # define _NULL_ nullPS
202 # define _CONS_ consPS
203 # define _HEAD_ headPS
204 # define _TAIL_ tailPS
205 # define _LENGTH_ lengthPS
206 # define _PK_ packString
207 # define _UNPK_ unpackPS
208 # define _SUBSTR_ substrPS
209 # define _APPEND_ `appendPS`
210 # define _CONCAT_ concatPS
213 # define FAST_STRING String
215 # define _CMP_STRING_ cmpString
221 # define _LENGTH_ length
222 # define _PK_ (\x->x)
223 # define _UNPK_ (\x->x)
224 # define _SUBSTR_ substr{-from Utils-}
226 # define _CONCAT_ concat