summaryrefslogtreecommitdiff
path: root/source3/include/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include/debug.h')
-rw-r--r--source3/include/debug.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/include/debug.h b/source3/include/debug.h
index cad802d8ca..37eaed2b12 100644
--- a/source3/include/debug.h
+++ b/source3/include/debug.h
@@ -150,41 +150,47 @@ struct debuglevel_message {
*/
#define DEBUGLVL( level ) \
- ( ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
+ ( ((level) <= MAX_DEBUG_LEVEL) && \
+ ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
(!DEBUGLEVEL_CLASS[ DBGC_CLASS ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
&& dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) )
#define DEBUGLVLC( dbgc_class, level ) \
- ( ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
+ ( ((level) <= MAX_DEBUG_LEVEL) && \
+ ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
&& dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) )
#define DEBUG( level, body ) \
- (void)( ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
+ (void)( ((level) <= MAX_DEBUG_LEVEL) && \
+ ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
&& (dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) )) \
&& (dbgtext body) )
#define DEBUGC( dbgc_class, level, body ) \
- (void)( ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
+ (void)( ((level) <= MAX_DEBUG_LEVEL) && \
+ ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
&& (dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) )) \
&& (dbgtext body) )
#define DEBUGADD( level, body ) \
- (void)( ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
+ (void)( ((level) <= MAX_DEBUG_LEVEL) && \
+ ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
&& (dbgtext body) )
#define DEBUGADDC( dbgc_class, level, body ) \
- (void)( ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
+ (void)( ((level) <= MAX_DEBUG_LEVEL) && \
+ ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
&& (dbgtext body) )