diff options
author | Lazaros Koromilas <lostd@2f30.org> | 2019-04-08 12:42:43 +0300 |
---|---|---|
committer | Lazaros Koromilas <lostd@2f30.org> | 2019-04-08 12:42:43 +0300 |
commit | 6b1ec1959954145d7942ba3b7e65f5cde30485a1 (patch) | |
tree | c3b903360d7d2e054bcd7f6dec51c82118c50e35 /util.h | |
parent | 16f473f55cd1510d6a641f860197a8c79ea57f23 (diff) | |
download | noice-6b1ec1959954145d7942ba3b7e65f5cde30485a1.tar.gz |
Move debug printing helpers to util header
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -3,3 +3,18 @@ size_t strlcat(char *, const char *, size_t); #undef strlcpy size_t strlcpy(char *, const char *, size_t); +#undef dprintf +int dprintf(int, const char *, ...); + +#ifdef DEBUG +#define DEBUG_FD 8 +#define DPRINTF_D(x) dprintf(DEBUG_FD, #x "=%d\n", x) +#define DPRINTF_U(x) dprintf(DEBUG_FD, #x "=%u\n", x) +#define DPRINTF_S(x) dprintf(DEBUG_FD, #x "=%s\n", x) +#define DPRINTF_P(x) dprintf(DEBUG_FD, #x "=0x%p\n", x) +#else +#define DPRINTF_D(x) +#define DPRINTF_U(x) +#define DPRINTF_S(x) +#define DPRINTF_P(x) +#endif /* DEBUG */ |