Mercurial > rcctl_linux
comparison debug.h @ 5:37e662c427a1
added message() macro
| author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
|---|---|
| date | Wed, 05 Jan 2011 22:32:12 +0900 |
| parents | b16b82dbfe87 |
| children |
comparison
equal
deleted
inserted
replaced
| 4:8781bb6d488d | 5:37e662c427a1 |
|---|---|
| 9 if(debug >= level) { \ | 9 if(debug >= level) { \ |
| 10 fprintf(stderr, "%s: %s():%4d: " fmt, __FILE__, __FUNCTION__, (int) __LINE__, ## __VA_ARGS__); \ | 10 fprintf(stderr, "%s: %s():%4d: " fmt, __FILE__, __FUNCTION__, (int) __LINE__, ## __VA_ARGS__); \ |
| 11 } \ | 11 } \ |
| 12 } while(0); | 12 } while(0); |
| 13 | 13 |
| 14 #define message(level, fmt, ...) \ | |
| 15 do { \ | |
| 16 if(debug >= level) { \ | |
| 17 fprintf(stderr, fmt, ## __VA_ARGS__); \ | |
| 18 } \ | |
| 19 } while(0); | |
| 20 | |
| 14 #endif | 21 #endif |
