From: Karel Zak Date: Fri, 21 Mar 2014 11:04:12 +0000 (+0100) Subject: include/debug: add another debug macros X-Git-Tag: v2.25-rc1~417 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e7b49879ad6ddb6a03f122916e5bcf7a1833deb2;p=thirdparty%2Futil-linux.git include/debug: add another debug macros Signed-off-by: Karel Zak --- diff --git a/include/debug.h b/include/debug.h index 069447967e..2eb9d4421e 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) \