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