# HG changeset patch # User Yoshiki Yazawa # Date 1294234332 -32400 # Node ID 37e662c427a1c8b5a12172f242eb39d700ecafcd # Parent 8781bb6d488daff63b9095565f91539a71e4b6cd added message() macro diff -r 8781bb6d488d -r 37e662c427a1 debug.h --- a/debug.h Wed Jan 05 22:31:47 2011 +0900 +++ b/debug.h Wed Jan 05 22:32:12 2011 +0900 @@ -11,4 +11,11 @@ } \ } while(0); +#define message(level, fmt, ...) \ + do { \ + if(debug >= level) { \ + fprintf(stderr, fmt, ## __VA_ARGS__); \ + } \ + } while(0); + #endif