6a01f6858d8a5180779bacb49b07415b3a800e0f
[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 #ifdef __GLASGOW_HASKELL__
14 #define TAG_ Int#
15 #define LT_ -1#
16 #define EQ_ 0#
17 #define GT_ 1#
18 #endif
19 #define GT__ _
20
21 #define COMMA ,
22
23 #ifdef DEBUG
24 #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
25 #else
26 #define ASSERT(e)
27 #endif
28 #define CHK_Ubiq() import Ubiq
29
30 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 26
31 #define trace _trace
32 #endif
33
34 #if defined(__GLASGOW_HASKELL__)
35 #define FAST_INT Int#
36 #define ILIT(x) (x#)
37 #define IBOX(x) (I# (x))
38 #define _ADD_ `plusInt#`
39 #define _SUB_ `minusInt#`
40 #define _MUL_ `timesInt#`
41 #define _DIV_ `divInt#`
42 #define _QUOT_ `quotInt#`
43 #define _NEG_ negateInt#
44 #define _EQ_ `eqInt#`
45 #define _LT_ `ltInt#`
46 #define _LE_ `leInt#`
47 #define _GE_ `geInt#`
48 #define _GT_ `gtInt#`
49
50 #define FAST_BOOL Int#
51 #define _TRUE_ 1#
52 #define _FALSE_ 0#
53 #define _IS_TRUE_(x) ((x) `eqInt#` 1#)
54
55 #else {- ! __GLASGOW_HASKELL__ -}
56
57 #define FAST_INT Int
58 #define ILIT(x) (x)
59 #define IBOX(x) (x)
60 #define _ADD_ +
61 #define _SUB_ -
62 #define _MUL_ *
63 #define _DIV_ `div`
64 #define _QUOT_ `quot`
65 #define _NEG_ -
66 #define _EQ_ ==
67 #define _LT_ <
68 #define _LE_ <=
69 #define _GE_ >=
70 #define _GT_ >
71
72 #define FAST_BOOL Bool
73 #define _TRUE_ True
74 #define _FALSE_ False
75 #define _IS_TRUE_(x) (x)
76
77 #endif  {- ! __GLASGOW_HASKELL__ -}
78
79 #if __GLASGOW_HASKELL__ >= 23
80 #define USE_FAST_STRINGS 1
81 #define FAST_STRING _PackedString
82 #define SLIT(x)     (_packCString (A# x#))
83 #define _CMP_STRING_ cmpPString
84 #define _NULL_      _nullPS
85 #define _NIL_       _nilPS
86 #define _CONS_      _consPS
87 #define _HEAD_      _headPS
88 #define _TAIL_      _tailPS
89 #define _LENGTH_    _lengthPS
90 #define _PK_        _packString
91 #define _UNPK_      _unpackPS
92 #define _SUBSTR_    _substrPS
93 #define _APPEND_    `_appendPS`
94 #define _CONCAT_    _concatPS
95 #else
96 #define FAST_STRING String
97 #define SLIT(x)     (x)
98 #define _CMP_STRING_ cmpString
99 #define _NULL_      null
100 #define _NIL_       ""
101 #define _CONS_      (:)
102 #define _HEAD_      head
103 #define _TAIL_      tail
104 #define _LENGTH_    length
105 #define _PK_        (\x->x)
106 #define _UNPK_      (\x->x)
107 #define _SUBSTR_    substr{-from Utils-}
108 #define _APPEND_    ++
109 #define _CONCAT_    concat
110 #endif
111
112 #endif