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