From 2776d2972d30e3391569401fdce57a4452fc76a7 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Sun, 14 Feb 2016 09:35:26 +0100 Subject: Make debug printing prettier. --- c_src/util.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'c_src/util.h') 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))); -- cgit v1.1