From 1b6f872f075ed73137f36d84b26dbd2c35f9eae9 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Fri, 21 Jun 2019 11:50:28 +0100 Subject: [PATCH] wmail: debug macro fixes. --- wmail/src/common.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wmail/src/common.h b/wmail/src/common.h index 4478b11..a2e114c 100644 --- a/wmail/src/common.h +++ b/wmail/src/common.h @@ -86,14 +86,16 @@ char *MakePathName( const char *dir, const char *file ); #ifdef DEBUG void TRACE( const char *fmt, ... ); -#define ASSERT( EXPR ) ((void)(EXPR ? 0 : ABORT( "%s(%i): Assertion failed: \"%s\"\n", __FILE__, __LINE__, #EXPR ))) -#define VERIFY( EXPR ) ASSERT( EXPR ) +#define ASSERT( EXPR ) do { \ + if ( !(EXPR) ) \ + ABORT( "%s(%i): Assertion failed: \"%s\"\n", \ + __FILE__, __LINE__, #EXPR ); \ +} while (0) #else #define TRACE( fmt... ) #define ASSERT( EXPR ) -#define VERIFY( EXPR ) #endif