summaryrefslogtreecommitdiff
path: root/source3/include/debug.h
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-11 20:44:19 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-11 20:44:19 +0200
commit2c4391e95002404fb2e1d09f97541c1ece1da46f (patch)
treebf903d374cfffd8bf868e1ac2ac351621b102f05 /source3/include/debug.h
parenta85f6634853a4cf825d70e07a789e96e1882f376 (diff)
downloadsamba-2c4391e95002404fb2e1d09f97541c1ece1da46f.tar.gz
samba-2c4391e95002404fb2e1d09f97541c1ece1da46f.tar.bz2
samba-2c4391e95002404fb2e1d09f97541c1ece1da46f.zip
Provide the same set of helper functions for DEBUG in Samba 3 and Samba
4, even though the macros are still different. This makes it possible to use object code compiled with one DEBUG() macro from the other sourceX directory.
Diffstat (limited to 'source3/include/debug.h')
-rw-r--r--source3/include/debug.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/include/debug.h b/source3/include/debug.h
index d1716320b3..56d0237c3f 100644
--- a/source3/include/debug.h
+++ b/source3/include/debug.h
@@ -40,11 +40,13 @@
int Debug1( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
/* PRINTFLIKE1 */
bool dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
-bool dbghdr( int level, int cls, const char *file, const char *func, int line );
+bool dbghdrclass( int level, int cls, const char *location, const char *func);
+bool dbghdr( int level, const char *location, const char *func);
#if defined(sgi) && (_COMPILER_VERSION >= 730)
#pragma mips_frequency_hint NEVER Debug1
#pragma mips_frequency_hint NEVER dbgtext
+#pragma mips_frequency_hint NEVER dbghdrclass
#pragma mips_frequency_hint NEVER dbghdr
#endif
@@ -192,7 +194,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
#define DEBUGLVL( level ) \
( CHECK_DEBUGLVL(level) \
- && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
+ && dbghdrclass( level, DBGC_CLASS, __location__, FUNCTION_MACRO ) )
#define DEBUGLVLC( dbgc_class, level ) \
@@ -200,7 +202,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
unlikely((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
- && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
+ && dbghdrclass( level, DBGC_CLASS, __location__, FUNCTION_MACRO) )
#define DEBUG( level, body ) \
@@ -208,7 +210,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
unlikely((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
- && (dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
+ && (dbghdrclass( level, DBGC_CLASS, __location__, FUNCTION_MACRO )) \
&& (dbgtext body) )
#define DEBUGC( dbgc_class, level, body ) \
@@ -216,7 +218,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
unlikely((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
- && (dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
+ && (dbghdrclass( level, DBGC_CLASS, __location__, FUNCTION_MACRO)) \
&& (dbgtext body) )
#define DEBUGADD( level, body ) \