include/debug: add another debug macros

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2014-03-21 12:04:12 +01:00
parent d282c88df5
commit e7b49879ad
1 changed files with 17 additions and 1 deletions

View File

@ -16,7 +16,7 @@
#define UL_DEBUG_DEFINE_FLAG(p, m) p ## m
/* l - library name, p - flag prefix, m - flag postfix, x - function */
# define __UL_DBG(l, p, m, x) \
#define __UL_DBG(l, p, m, x) \
do { \
if ((p ## m) & l ## _debug_mask) { \
fprintf(stderr, "%d: %s: %8s: ", getpid(), # l, # m); \
@ -24,6 +24,22 @@
} \
} while (0)
#define __UL_DBG_CALL(l, p, m, x) \
do { \
if ((p ## m) & l ## _debug_mask) { \
x; \
} \
} while (0)
#define __UL_DBG_FLUSH(l, p) \
do { \
if (l ## _debug_mask && \
l ## _debug_mask != p ## INIT) { \
fflush(stderr); \
} \
} while (0)
#define __UL_INIT_DEBUG(lib, pref, mask, env) \
do { \
if (lib ## _debug_mask & pref ## INIT) \