diff options
-rw-r--r-- | include/debug.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/debug.h b/include/debug.h index 069447967..2eb9d4421 100644 --- a/include/debug.h +++ b/include/debug.h @@ -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) \ |