src/utils.h

Wed, 29 Dec 2010 01:38:54 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Wed, 29 Dec 2010 01:38:54 +0000
changeset 74
51cbc7a44cd9
parent 71
22452603e214
child 88
4e5d95fa96e1
permissions
-rw-r--r--

add first cut keyboard driver

philpem@71 1 #ifndef _H_UTILS
philpem@71 2 #define _H_UTILS
philpem@71 3
philpem@71 4 #ifndef NDEBUG
philpem@71 5 /// Log a message to stderr
philpem@71 6 # define LOG(x, ...) do { fprintf(stderr, "%s:%d:%s(): " x "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); } while (0)
philpem@71 7 /// Log a message to stderr if 'cond' is true
philpem@71 8 # define LOG_IF(cond, x, ...) do { if (cond) fprintf(stderr, "%s:%d:%s(): " x "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); } while (0)
philpem@71 9 #else
philpem@71 10 #define LOG(x, ...)
philpem@71 11 #define LOG_IF(cond, x, ...)
philpem@71 12 #endif
philpem@71 13
philpem@71 14 #endif // _H_UTILS