diff options
| author | Magnus Ahltorp <map@kth.se> | 2016-02-14 09:35:26 +0100 |
|---|---|---|
| committer | Magnus Ahltorp <map@kth.se> | 2016-02-14 09:35:26 +0100 |
| commit | 4ed13eaf6303faa4050ed483534550c9b7414eba (patch) | |
| tree | 9ca81433f1139d5ce975c167255dee3979351174 /c_src/util.h | |
| parent | 25782827512ba734c6deb04939c1fd22f55fd3b0 (diff) | |
Make debug printing prettier.
Diffstat (limited to 'c_src/util.h')
| -rw-r--r-- | c_src/util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/c_src/util.h b/c_src/util.h index 976ee8e..4af8005 100644 --- a/c_src/util.h +++ b/c_src/util.h @@ -11,6 +11,9 @@ #define DEBUG_READ 0 #define DEBUG_PORT 0 +#define dprintf(level,args) do { if (DEBUG_ ## level) { fprintf args; } } while (0) +#define dprinthex(level,data,size) do { if (DEBUG_ ## level) { print_hex(data, size); } } while (0) + void set_error(char **error, const char * __restrict, ...) __attribute__ ((__format__ (__printf__, 2, 3))); |
