[project @ 2004-02-12 02:04:59 by mthomas]
[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 #if __GLASGOW_HASKELL__ >= 620
56 #define UNBOX_FIELD !!
57 #else
58 #define UNBOX_FIELD !
59 #endif
60
61 #define COMMA ,
62
63 #ifdef DEBUG
64 #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
65 #define ASSERT2(e,msg) if (not (e)) then (assertPprPanic __FILE__ __LINE__ (msg)) else
66 #define WARN( e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg))
67 #define ASSERTM(e) ASSERT(e) do
68 #else
69 #define ASSERT(e)
70 #define ASSERT2(e,msg)
71 #define ASSERTM(e)
72 #define WARN(e,msg)
73 #endif
74
75 -- temporary usage assertion control KSW 2000-10
76 #ifdef DO_USAGES
77 #define UASSERT(e) ASSERT(e)
78 #define UASSERT2(e,msg) ASSERT2(e,msg)
79 #else
80 #define UASSERT(e)
81 #define UASSERT2(e,msg)
82 #endif
83
84 -- This #ifndef lets us switch off the "import FastString"
85 -- when compiling FastString itself
86 #ifndef COMPILING_FAST_STRING
87 -- 
88 import qualified FastString 
89 #endif
90
91 #define SLIT(x)  (FastString.mkLitString# (x#))
92 #define FSLIT(x) (FastString.mkFastString# (x#))
93
94 #endif // HSVERSIONS_H