Mercurial > rcctl_linux
diff debug.h @ 2:b16b82dbfe87
massive cleanup
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 05 Jan 2011 21:41:39 +0900 |
parents | |
children | 37e662c427a1 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debug.h Wed Jan 05 21:41:39 2011 +0900 @@ -0,0 +1,14 @@ +#ifndef __RCCTL_DEBUG_H__ +#define __RCCTL_DEBUG_H__ + +extern int debug; + +/* print debug message if specified level is greater enough */ +#define debug(level, fmt, ...) \ + do { \ + if(debug >= level) { \ + fprintf(stderr, "%s: %s():%4d: " fmt, __FILE__, __FUNCTION__, (int) __LINE__, ## __VA_ARGS__); \ + } \ + } while(0); + +#endif