diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-06 03:48:04 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-06 03:48:04 +0200 |
commit | 47c3179fb2dc5af83d776d1fd6c06cc468fc9264 (patch) | |
tree | 53c32d765341caa5c4a7be26f99436f9cd6f77c6 /netifd.h | |
parent | d6ea48d146b4fa2905afa4acc2ff34b37ce5a623 (diff) |
improve debugging macro
Diffstat (limited to 'netifd.h')
-rw-r--r-- | netifd.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -23,7 +23,10 @@ enum { #ifdef DEBUG #define DPRINTF(format, ...) fprintf(stderr, "%s(%d): " format, __func__, __LINE__, ## __VA_ARGS__) -#define D(level, format, ...) if (debug_mask & (1 << (DEBUG_ ## level))) DPRINTF(format, ##__VA_ARGS__) +#define D(level, format, ...) do { \ + if (debug_mask & (1 << (DEBUG_ ## level))) \ + DPRINTF(format, ##__VA_ARGS__); \ + } while (0) #else #define DPRINTF(format, ...) no_debug(0, format, ## __VA_ARGS__) #define D(level, format, ...) no_debug(DEBUG_ ## level, format, ## __VA_ARGS__) |