diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-10-11 20:44:19 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-11 20:44:19 +0200 |
commit | 2c4391e95002404fb2e1d09f97541c1ece1da46f (patch) | |
tree | bf903d374cfffd8bf868e1ac2ac351621b102f05 /source3/include | |
parent | a85f6634853a4cf825d70e07a789e96e1882f376 (diff) | |
download | samba-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')
-rw-r--r-- | source3/include/debug.h | 12 | ||||
-rw-r--r-- | source3/include/proto.h | 3 |
2 files changed, 9 insertions, 6 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 ) \ diff --git a/source3/include/proto.h b/source3/include/proto.h index 3df87a6c34..bf66908fd1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -486,7 +486,8 @@ void force_check_log_size( void ); bool need_to_check_log_size( void ); void check_log_size( void ); void dbgflush( void ); -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); TALLOC_CTX *debug_ctx(void); /* The following definitions come from lib/display_sec.c */ |