X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FHsVersions.h;h=a53fb4bf35fa410a8afa59c570ddddcb5af53966;hb=f8c52d7fde2d7408b4f734251c373f8d3e2c558e;hp=299ad68357a4f3a64bc6b3a852dde94403c6aa66;hpb=a6e486cfe0ea35e9744d99ea489f72f51f7d29e3;p=ghc-hetmet.git diff --git a/compiler/HsVersions.h b/compiler/HsVersions.h index 299ad68..a53fb4b 100644 --- a/compiler/HsVersions.h +++ b/compiler/HsVersions.h @@ -34,12 +34,6 @@ name = Util.global (value) :: IORef (ty); \ {-# NOINLINE name #-} #endif -#if __GLASGOW_HASKELL__ >= 620 -#define UNBOX_FIELD !! -#else -#define UNBOX_FIELD ! -#endif - #define COMMA , #ifdef DEBUG @@ -49,11 +43,14 @@ name = Util.global (value) :: IORef (ty); \ #define ASSERTM(mbool) do { bool <- mbool; ASSERT(bool) return () } #define ASSERTM2(mbool,msg) do { bool <- mbool; ASSERT2(bool,msg) return () } #else -#define ASSERT(e) if False then error "ASSERT" else -#define ASSERT2(e,msg) if False then error "ASSERT2" else -#define ASSERTM(e) -#define ASSERTM2(e,msg) -#define WARN(e,msg) if False then error "WARN" else +-- We have to actually use all the variables we are given or we may get +-- unused variable warnings when DEBUG is off. +#define ASSERT(e) if False && (not (e)) then panic "ASSERT" else +#define ASSERT2(e,msg) if False && (not (e)) then pprPanic "ASSERT2" (msg) else +#define ASSERTM(e) do { let { _mbool = (e) } } +-- Here we deliberately don't use when as Control.Monad might not be imported +#define ASSERTM2(e,msg) do { let { _mbool = (e) }; if False then panic "ASSERTM2" else return () } +#define WARN(e,msg) if False && (e) then pprPanic "WARN" (msg) else #endif -- This #ifndef lets us switch off the "import FastString"