[project @ 2002-09-06 14:35:42 by simonmar]
[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 #if __GLASGOW_HASKELL__ >= 504
14
15 #define CONCURRENT  Control.Concurrent
16 #define EXCEPTION   Control.Exception
17 #define DYNAMIC     Data.Dynamic
18 #define GLAEXTS     GHC.Exts
19 #define DATA_BITS   Data.Bits
20 #define DATA_INT    Data.Int
21 #define DATA_WORD   Data.Word
22 #define UNSAFE_IO   System.IO.Unsafe
23 #define TRACE       Debug.Trace
24 #define DATA_IOREF  Data.IORef
25 #define FIX_IO      System.IO
26 #define MONAD_ST    Control.Monad.ST
27 #define ST_ARRAY    Data.Array.ST
28
29 #else
30
31 #define CONCURRENT  Concurrent
32 #define EXCEPTION   Exception
33 #define DYNAMIC     Dynamic
34 #define GLAEXTS     GlaExts
35 #define DATA_BITS   Bits
36 #define DATA_INT    Int
37 #define DATA_WORD   Word
38 #define UNSAFE_IO   IOExts
39 #define TRACE       IOExts
40 #define DATA_IOREF  IOExts
41 #define FIX_IO      IOExts
42 #define MONAD_ST    ST
43 #define ST_ARRAY    ST
44
45 #endif
46
47 #ifdef __GLASGOW_HASKELL__
48 #define GLOBAL_VAR(name,value,ty)  \
49 name = Util.global (value) :: IORef (ty); \
50 {-# NOINLINE name #-}
51 #endif
52
53 #define COMMA ,
54
55 #ifdef DEBUG
56 #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
57 #define ASSERT2(e,msg) if (not (e)) then (assertPprPanic __FILE__ __LINE__ (msg)) else
58 #define WARN( e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg))
59 #else
60 #define ASSERT(e)
61 #define ASSERT2(e,msg)
62 #define WARN(e,msg)
63 #endif
64
65 -- temporary usage assertion control KSW 2000-10
66 #ifdef DO_USAGES
67 #define UASSERT(e) ASSERT(e)
68 #define UASSERT2(e,msg) ASSERT2(e,msg)
69 #else
70 #define UASSERT(e)
71 #define UASSERT2(e,msg)
72 #endif
73
74 -- This #ifndef lets us switch off the "import FastString"
75 -- when compiling FastString itself
76 #ifndef COMPILING_FAST_STRING
77 -- 
78 import qualified FastString 
79 #endif
80
81 #define SLIT(x)  (FastString.mkLitString# (x#))
82 #define FSLIT(x) (FastString.mkFastString# (x#))
83
84 #endif // HSVERSIONS_H