[project @ 1996-06-05 06:44:31 by partain]
[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
29 #if __STDC__
30 #define CAT2(a,b)a##b
31 #else
32 #define CAT2(a,b)a/**/b
33 #endif
34
35 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 200
36 # define REALLY_HASKELL_1_3
37 # define SYN_IE(a) a
38 # define IMPORT_DELOOPER(mod) import CAT2(mod,_1_3)
39 # define IMPORT_1_3(mod) import mod
40 # define _tagCmp compare
41 # define _LT LT
42 # define _EQ EQ
43 # define _GT GT
44 # define Text Show
45 #else
46 # define SYN_IE(a) a(..)
47 # define IMPORT_DELOOPER(mod) import mod
48 # define IMPORT_1_3(mod) {--}
49 #endif
50 #define IMP_Ubiq() IMPORT_DELOOPER(Ubiq)
51 #define CHK_Ubiq() IMPORT_DELOOPER(Ubiq)
52
53 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 26
54 #define trace _trace
55 #endif
56
57 #if defined(__GLASGOW_HASKELL__)
58 #define FAST_INT Int#
59 #define ILIT(x) (x#)
60 #define IBOX(x) (I# (x))
61 #define _ADD_ `plusInt#`
62 #define _SUB_ `minusInt#`
63 #define _MUL_ `timesInt#`
64 #define _DIV_ `divInt#`
65 #define _QUOT_ `quotInt#`
66 #define _NEG_ negateInt#
67 #define _EQ_ `eqInt#`
68 #define _LT_ `ltInt#`
69 #define _LE_ `leInt#`
70 #define _GE_ `geInt#`
71 #define _GT_ `gtInt#`
72
73 #define FAST_BOOL Int#
74 #define _TRUE_ 1#
75 #define _FALSE_ 0#
76 #define _IS_TRUE_(x) ((x) `eqInt#` 1#)
77
78 #else {- ! __GLASGOW_HASKELL__ -}
79
80 #define FAST_INT Int
81 #define ILIT(x) (x)
82 #define IBOX(x) (x)
83 #define _ADD_ +
84 #define _SUB_ -
85 #define _MUL_ *
86 #define _DIV_ `div`
87 #define _QUOT_ `quot`
88 #define _NEG_ -
89 #define _EQ_ ==
90 #define _LT_ <
91 #define _LE_ <=
92 #define _GE_ >=
93 #define _GT_ >
94
95 #define FAST_BOOL Bool
96 #define _TRUE_ True
97 #define _FALSE_ False
98 #define _IS_TRUE_(x) (x)
99
100 #endif  {- ! __GLASGOW_HASKELL__ -}
101
102 #if __GLASGOW_HASKELL__ >= 23 && __GLASGOW_HASKELL__ < 200
103 #define USE_FAST_STRINGS 1
104 #define FAST_STRING _PackedString
105 #define SLIT(x)     (_packCString (A# x#))
106 #define _CMP_STRING_ cmpPString
107 #define _NULL_      _nullPS
108 #define _NIL_       _nilPS
109 #define _CONS_      _consPS
110 #define _HEAD_      _headPS
111 #define _TAIL_      _tailPS
112 #define _LENGTH_    _lengthPS
113 #define _PK_        _packString
114 #define _UNPK_      _unpackPS
115 #define _SUBSTR_    _substrPS
116 #define _APPEND_    `_appendPS`
117 #define _CONCAT_    _concatPS
118 #else
119 #define FAST_STRING String
120 #define SLIT(x)     (x)
121 #define _CMP_STRING_ cmpString
122 #define _NULL_      null
123 #define _NIL_       ""
124 #define _CONS_      (:)
125 #define _HEAD_      head
126 #define _TAIL_      tail
127 #define _LENGTH_    length
128 #define _PK_        (\x->x)
129 #define _UNPK_      (\x->x)
130 #define _SUBSTR_    substr{-from Utils-}
131 #define _APPEND_    ++
132 #define _CONCAT_    concat
133 #endif
134
135 #endif