wrap print progress in pprint

This commit is contained in:
Ryo Nakamura
2022-10-25 01:47:39 +09:00
parent c83927cd5a
commit 47f6983148
6 changed files with 84 additions and 40 deletions

View File

@@ -8,20 +8,6 @@
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
extern int verbose;
#define pr_v(level, fmt, ...) do { \
if (verbose >= level) { \
fprintf(stdout, "\x1b[1m\x1b[34m" \
"%s(): \x1b[0m" fmt, \
__func__, ##__VA_ARGS__); \
} \
} while (0)
#define pr_v1(fmt, ...) pr_v(1, fmt, ##__VA_ARGS__)
#define pr_v2(fmt, ...) pr_v(2, fmt, ##__VA_ARGS__)
#define pr_v3(fmt, ...) pr_v(3, fmt, ##__VA_ARGS__)
#define pr(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)