From 5a5049cd77c608134c87a2332b8a070c01731680 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 13:12:09 +0000 Subject: removed the if statements from the DEBUG() macro definitions. Chris, you should never put if statements in macros, use the ugly (a?b:c) form instead, otherwise you can produce incorrect code when you have things like: if (foo) DEBUG((blah)); else DEBUG((blooh)); (This used to be commit ab912448c1ff2487b6a313574d72f389baa65e6d) --- source3/include/smb.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/include/smb.h b/source3/include/smb.h index b33db0ce66..f8a055ad48 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -142,12 +142,12 @@ BOOL dbgtext(); && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) #define DEBUG( level, body ) \ - if( (DEBUGLEVEL>=(level)) \ - && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) \ - (void)dbgtext body + ((DEBUGLEVEL>=(level) && \ + dbghdr(level, FILE_MACRO, FUNCTION_MACRO, (__LINE__)))? \ + (void)dbgtext body:0) #define DEBUGADD( level, body ) \ - if( DEBUGLEVEL>=(level) ) (void)dbgtext body + (DEBUGLEVEL>=(level)?(void)dbgtext body:0); /* End Debugging code section. * -------------------------------------------------------------------------- ** -- cgit