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)
13 #ifdef __GLASGOW_HASKELL__
14 #define GLOBAL_VAR(name,value,ty) \
15 name = global (value) :: IORef (ty); \
22 #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
23 #define ASSERT2(e,msg) if (not (e)) then (assertPprPanic __FILE__ __LINE__ (msg)) else
24 #define WARN( e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg))
27 #define ASSERT2(e,msg)
34 #define CAT2(a,b)a/**/b
37 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 202
38 # define failWith fail
39 # define MkIOError(h,errt,msg) (IOError (Just h) errt msg)
40 # define minInt (minBound::Int)
41 # define maxInt (maxBound::Int)
43 # define MkIOError(h,errt,msg) (errt msg)
46 #if defined(__GLASGOW_HASKELL__)
50 ( Int(..), Int#, (+#), (-#), (*#),
51 quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
56 #define IBOX(x) (I# (x))
60 #define _QUOT_ `quotInt#`
61 #define _NEG_ negateInt#
68 #define FAST_BOOL Int#
71 #define _IS_TRUE_(x) ((x) _EQ_ 1#)
73 #else {- ! __GLASGOW_HASKELL__ -}
90 #define FAST_BOOL Bool
93 #define _IS_TRUE_(x) (x)
95 #endif {- ! __GLASGOW_HASKELL__ -}
97 #if __GLASGOW_HASKELL__ >= 23
99 -- This #ifndef lets us switch off the "import FastString"
100 -- when compiling FastString itself
101 #ifndef COMPILING_FAST_STRING
103 import qualified FastString
106 # define USE_FAST_STRINGS 1
107 # define FAST_STRING FastString.FastString
108 # define SLIT(x) (FastString.mkFastCharString# (x#))
109 # define _NULL_ FastString.nullFastString
110 # define _NIL_ (FastString.mkFastString "")
111 # define _CONS_ FastString.consFS
112 # define _HEAD_ FastString.headFS
113 # define _HEAD_INT_ FastString.headIntFS
114 # define _TAIL_ FastString.tailFS
115 # define _LENGTH_ FastString.lengthFS
116 # define _PK_ FastString.mkFastString
117 # define _PK_INT_ FastString.mkFastStringInt
118 # define _UNPK_ FastString.unpackFS
119 # define _UNPK_INT_ FastString.unpackIntFS
120 # define _APPEND_ `FastString.appendFS`
121 # define _CONCAT_ FastString.concatFS
123 # error I think that FastString is now always used. If not, fix this.
124 # define FAST_STRING String
126 # define _CMP_STRING_ cmpString
132 # define _LENGTH_ length
133 # define _PK_ (\x->x)
134 # define _UNPK_ (\x->x)
135 # define _SUBSTR_ substr{-from Utils-}
137 # define _CONCAT_ concat
142 # define ISALPHANUM isAlphaNum
143 # define IOERROR ioError
148 # define ISALPHANUM isAlphanum
149 # define IOERROR fail
150 # define PSEQ (\x y -> y)