Disable cross compilation for now
[ghc.git] / compiler / HsVersions.h
1 #pragma once
2
3 #if 0
4
5 IMPORTANT! If you put extra tabs/spaces in these macro definitions,
6 you will screw up the layout where they are used in case expressions!
7
8 (This is cpp-dependent, of course)
9
10 #endif
11
12 /* Useful in the headers that we share with the RTS */
13 #define COMPILING_GHC 1
14
15 /* Pull in all the platform defines for this build (foo_TARGET_ARCH etc.) */
16 #include "ghc_boot_platform.h"
17
18 /* Pull in the autoconf defines (HAVE_FOO), but don't include
19 * ghcconfig.h, because that will include ghcplatform.h which has the
20 * wrong platform settings for the compiler (it has the platform
21 * settings for the target plat instead). */
22 #include "ghcautoconf.h"
23
24 #define GLOBAL_VAR(name,value,ty) \
25 {-# NOINLINE name #-}; \
26 name :: IORef (ty); \
27 name = Util.global (value);
28
29 #define GLOBAL_VAR_M(name,value,ty) \
30 {-# NOINLINE name #-}; \
31 name :: IORef (ty); \
32 name = Util.globalM (value);
33
34
35 #define SHARED_GLOBAL_VAR(name,accessor,saccessor,value,ty) \
36 {-# NOINLINE name #-}; \
37 name :: IORef (ty); \
38 name = Util.sharedGlobal (value) (accessor); \
39 foreign import ccall unsafe saccessor \
40 accessor :: Ptr (IORef a) -> IO (Ptr (IORef a));
41
42 #define SHARED_GLOBAL_VAR_M(name,accessor,saccessor,value,ty) \
43 {-# NOINLINE name #-}; \
44 name :: IORef (ty); \
45 name = Util.sharedGlobalM (value) (accessor); \
46 foreign import ccall unsafe saccessor \
47 accessor :: Ptr (IORef a) -> IO (Ptr (IORef a));
48
49
50 #define ASSERT(e) if debugIsOn && not (e) then (assertPanic __FILE__ __LINE__) else
51 #define ASSERT2(e,msg) if debugIsOn && not (e) then (assertPprPanic __FILE__ __LINE__ (msg)) else
52 #define WARN( e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg)) $
53
54 -- Examples: Assuming flagSet :: String -> m Bool
55 --
56 -- do { c <- getChar; MASSERT( isUpper c ); ... }
57 -- do { c <- getChar; MASSERT2( isUpper c, text "Bad" ); ... }
58 -- do { str <- getStr; ASSERTM( flagSet str ); .. }
59 -- do { str <- getStr; ASSERTM2( flagSet str, text "Bad" ); .. }
60 -- do { str <- getStr; WARNM2( flagSet str, text "Flag is set" ); .. }
61 #define MASSERT(e) ASSERT(e) return ()
62 #define MASSERT2(e,msg) ASSERT2(e,msg) return ()
63 #define ASSERTM(e) do { bool <- e; MASSERT(bool) }
64 #define ASSERTM2(e,msg) do { bool <- e; MASSERT2(bool,msg) }
65 #define WARNM2(e,msg) do { bool <- e; WARN(bool, msg) return () }