From 2c4391e95002404fb2e1d09f97541c1ece1da46f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Oct 2008 20:44:19 +0200 Subject: 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. --- source3/lib/debug.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source3/lib/debug.c') diff --git a/source3/lib/debug.c b/source3/lib/debug.c index d91b55dd23..be2707b595 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -984,7 +984,7 @@ 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) { /* Ensure we don't lose any real errno value. */ int old_errno = errno; @@ -1046,10 +1046,10 @@ bool dbghdr(int level, int cls, const char *file, const char *func, int line) lp_debug_hires_timestamp()), level, header_str); } else { - (void)Debug1( "[%s, %2d%s] %s:%s(%d)\n", + (void)Debug1( "[%s, %2d%s] %s(%s)\n", current_timestring(debug_ctx(), lp_debug_hires_timestamp()), - level, header_str, file, func, line ); + level, header_str, location, func ); } } @@ -1057,6 +1057,12 @@ bool dbghdr(int level, int cls, const char *file, const char *func, int line) return( True ); } +bool dbghdr(int level, const char *location, const char *func) +{ + /* For compatibility with Samba 4, which doesn't have debug classes */ + return dbghdrclass(level, 0, location, func); +} + /*************************************************************************** Add text to the body of the "current" debug message via the format buffer. -- cgit