c630c8dcfa7e6953115fb9ad5a02d218114ae856
[ghc-hetmet.git] / ghc / compiler / HsVersions.h
1 #ifndef HSVERSIONS_H
2 #define HSVERSIONS_H
3
4 #if 0
5
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!
8
9 (This is cpp-dependent, of course)
10
11 #endif
12
13 #define COMMA ,
14
15 #ifdef DEBUG
16 #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
17 #else
18 #define ASSERT(e)
19 #endif
20
21 #if __STDC__
22 #define CAT2(a,b)a##b
23 #else
24 #define CAT2(a,b)a/**/b
25 #endif
26
27 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 200
28 # define REALLY_HASKELL_1_3
29 # define SYN_IE(a) a
30 # define EXP_MODULE(a) module a
31 # define IMPORT_DELOOPER(mod) import CAT2(mod,_1_3)
32 # define IMPORT_1_3(mod) import mod
33 # define _tagCmp compare
34 # define _LT LT
35 # define _EQ EQ
36 # define _GT GT
37 # define _Addr GHCbase.Addr
38 # define Text Show
39 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq); import qualified GHCbase
40 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq); import qualified GHCbase
41 # define minInt (minBound::Int)
42 # define maxInt (maxBound::Int)
43 #else
44 # define SYN_IE(a) a(..)
45 # define EXP_MODULE(a) a..
46 # define IMPORT_DELOOPER(mod) import mod
47 # define IMPORT_1_3(mod) {--}
48 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq)
49 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq)
50 #endif
51
52 #if __GLASGOW_HASKELL__ >= 26 && __GLASGOW_HASKELL__ < 200
53 #define trace _trace
54 #endif
55
56 #define TAG_ Int#
57 #define LT_ -1#
58 #define EQ_ 0#
59 #define GT_ 1#
60 #define GT__ _
61
62 #if defined(__GLASGOW_HASKELL__)
63 #define FAST_INT Int#
64 #define ILIT(x) (x#)
65 #define IBOX(x) (I# (x))
66 #define _ADD_ `plusInt#`
67 #define _SUB_ `minusInt#`
68 #define _MUL_ `timesInt#`
69 #define _DIV_ `divInt#`
70 #define _QUOT_ `quotInt#`
71 #define _NEG_ negateInt#
72 #define _EQ_ `eqInt#`
73 #define _LT_ `ltInt#`
74 #define _LE_ `leInt#`
75 #define _GE_ `geInt#`
76 #define _GT_ `gtInt#`
77
78 #define FAST_BOOL Int#
79 #define _TRUE_ 1#
80 #define _FALSE_ 0#
81 #define _IS_TRUE_(x) ((x) `eqInt#` 1#)
82
83 #else {- ! __GLASGOW_HASKELL__ -}
84
85 #define FAST_INT Int
86 #define ILIT(x) (x)
87 #define IBOX(x) (x)
88 #define _ADD_ +
89 #define _SUB_ -
90 #define _MUL_ *
91 #define _DIV_ `div`
92 #define _QUOT_ `quot`
93 #define _NEG_ -
94 #define _EQ_ ==
95 #define _LT_ <
96 #define _LE_ <=
97 #define _GE_ >=
98 #define _GT_ >
99
100 #define FAST_BOOL Bool
101 #define _TRUE_ True
102 #define _FALSE_ False
103 #define _IS_TRUE_(x) (x)
104
105 #endif  {- ! __GLASGOW_HASKELL__ -}
106
107 #if __GLASGOW_HASKELL__ >= 23
108 # define USE_FAST_STRINGS 1
109 # if __GLASGOW_HASKELL__ < 200
110 #  define FAST_STRING   _PackedString
111 #  define SLIT(x)       (_packCString (A# x#))
112 #  define _CMP_STRING_  cmpPString
113         /* cmpPString defined in utils/Util.lhs */
114 #  define _NULL_        _nullPS
115 #  define _NIL_         _nilPS
116 #  define _CONS_        _consPS
117 #  define _HEAD_        _headPS
118 #  define _TAIL_        _tailPS
119 #  define _LENGTH_      _lengthPS
120 #  define _PK_          _packString
121 #  define _UNPK_        _unpackPS
122 #  define _SUBSTR_      _substrPS
123 #  define _APPEND_      `_appendPS`
124 #  define _CONCAT_      _concatPS
125 # else
126 #  define FAST_STRING   GHCbase.PackedString
127 #  define SLIT(x)       (packCString (GHCbase.A# x#))
128 #  define _CMP_STRING_  cmpPString
129 #  define _NULL_        nullPS
130 #  define _NIL_         nilPS
131 #  define _CONS_        consPS
132 #  define _HEAD_        headPS
133 #  define _TAIL_        tailPS
134 #  define _LENGTH_      lengthPS
135 #  define _PK_          packString
136 #  define _UNPK_        unpackPS
137 #  define _SUBSTR_      substrPS
138 #  define _APPEND_      `appendPS`
139 #  define _CONCAT_      concatPS
140 # endif
141 #else
142 # define FAST_STRING String
143 # define SLIT(x)      (x)
144 # define _CMP_STRING_ cmpString
145 # define _NULL_       null
146 # define _NIL_        ""
147 # define _CONS_       (:)
148 # define _HEAD_       head
149 # define _TAIL_       tail
150 # define _LENGTH_     length
151 # define _PK_         (\x->x)
152 # define _UNPK_       (\x->x)
153 # define _SUBSTR_     substr{-from Utils-}
154 # define _APPEND_     ++
155 # define _CONCAT_     concat
156 #endif
157
158 #endif