summaryrefslogtreecommitdiff
path: root/source4/lib/util/debug.h
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-02-04 09:56:24 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-02-04 09:56:24 +1100
commitcbca41597e0829ee0b1535b2902696a448373045 (patch)
treee3162199c03f56f02382c8514c289aa238e605d0 /source4/lib/util/debug.h
parent3231717e1485c70890c23fbfc3087d970a408815 (diff)
parentc3008e086b1a87c5f4add2a7d1474c2f9a34bfd2 (diff)
downloadsamba-cbca41597e0829ee0b1535b2902696a448373045.tar.gz
samba-cbca41597e0829ee0b1535b2902696a448373045.tar.bz2
samba-cbca41597e0829ee0b1535b2902696a448373045.zip
Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-abartlet
(This used to be commit 377a7c633d4813c134b91739c507dcefb55c9691)
Diffstat (limited to 'source4/lib/util/debug.h')
-rw-r--r--source4/lib/util/debug.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/util/debug.h b/source4/lib/util/debug.h
index 1895ed53ad..605628174a 100644
--- a/source4/lib/util/debug.h
+++ b/source4/lib/util/debug.h
@@ -41,13 +41,17 @@ struct debug_ops {
extern int DEBUGLEVEL;
+#define debug_ctx() (_debug_ctx?_debug_ctx:(_debug_ctx=talloc_new(NULL)))
+
#define DEBUGLVL(level) ((level) <= DEBUGLEVEL)
#define _DEBUG(level, body, header) do { \
if (DEBUGLVL(level)) { \
+ void* _debug_ctx=NULL; \
if (header) { \
do_debug_header(level, __location__, __FUNCTION__); \
} \
do_debug body; \
+ talloc_free(_debug_ctx); \
} \
} while (0)
/**