From e6a4af6694f213311bd07c27ccf21c2193740f32 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 25 Sep 2010 02:05:25 -0400 Subject: mtd-utils: new bareverbose() helper Add a new helper that lets people do simple verbose output without any implicit strings added around it. Good for progress bars and such. Signed-off-by: Mike Frysinger Signed-off-by: Artem Bityutskiy --- include/common.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/common.h b/include/common.h index e87b215..11b0cf6 100644 --- a/include/common.h +++ b/include/common.h @@ -38,10 +38,12 @@ extern "C" { #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) /* Verbose messages */ -#define verbose(verbose, fmt, ...) do { \ +#define bareverbose(verbose, fmt, ...) do { \ if (verbose) \ - printf(PROGRAM_NAME ": " fmt "\n", ##__VA_ARGS__); \ + printf(fmt, ##__VA_ARGS__); \ } while(0) +#define verbose(verbose, fmt, ...) \ + bareverbose(verbose, PROGRAM_NAME ": " fmt "\n", ##__VA_ARGS__) /* Normal messages */ #define normsg(fmt, ...) do { \ -- cgit v1.2.3