diff options
author | Linus Walleij <triad@df.lth.se> | 2009-10-10 21:39:44 +0000 |
---|---|---|
committer | Linus Walleij <triad@df.lth.se> | 2009-10-10 21:39:44 +0000 |
commit | 8f6e0d9db0580deb1fdabd980cd5e0088600c8d7 (patch) | |
tree | c8fa2f713c60af9de1303ed95171ab8f907492fb /src/util.h | |
parent | 12ce6b0c6332cda8c82bd018762b986cc973b0de (diff) | |
download | libmtp-8f6e0d9db0580deb1fdabd980cd5e0088600c8d7.tar.gz |
Move debugmacros to util.h
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -26,4 +26,27 @@ void data_dump(FILE *f, void *buf, uint32_t nbytes); void data_dump_ascii (FILE *f, void *buf, uint32_t n, uint32_t dump_boundry); +/** + * Info macro + */ +#define LIBMTP_INFO(format, args...) \ + do { \ + if (LIBMTP_debug != 0) \ + fprintf(stdout, "LIBMTP %s[%d]: " format, __FUNCTION__, __LINE__, ##args); \ + else \ + fprintf(stdout, format, ##args); \ + } while (0) + +/** + * Error macro + */ +#define LIBMTP_ERROR(format, args...) \ + do { \ + if (LIBMTP_debug != 0) \ + fprintf(stderr, "LIBMTP %s[%d]: " format, __FUNCTION__, __LINE__, ##args); \ + else \ + fprintf(stderr, format, ##args); \ + } while (0) + + #endif //__MTP__UTIL__H |