From f8c52d7fde2d7408b4f734251c373f8d3e2c558e Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 8 Sep 2007 00:31:12 +0000 Subject: Make various assertions work when !DEBUG --- compiler/HsVersions.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/HsVersions.h') diff --git a/compiler/HsVersions.h b/compiler/HsVersions.h index fb47f7cba5..a53fb4bf35 100644 --- a/compiler/HsVersions.h +++ b/compiler/HsVersions.h @@ -48,8 +48,9 @@ name = Util.global (value) :: IORef (ty); \ #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) } } -#define ASSERTM2(e,msg) do { let { _mbool = (e) }; when False (panic "ASSERTM2") } -#define WARN(e,msg) if False && (e) then pprPanic "WARN" msg else +-- 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" -- cgit v1.2.1