diff options
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -19,6 +19,7 @@ enum debug_category { DBG_CFG = (0x1 << 4), DBG_REF = (0x1 << 5), DBG_MALLOC = (0x1 << 6), + DBG_ANN = (0x1 << 7), }; static inline bool @@ -35,11 +36,12 @@ void __debug(enum debug_category category, const char *fmt, ...) __attribute__(( __debug((c), fmt __VA_OPT__(,) __VA_ARGS__); \ } while (0) -#define debug(c, fmt, ...) __ifdebug((c), "%s:%i: " fmt, __func__, \ - __LINE__, __VA_ARGS__) +#define debug(c, fmt, ...) __ifdebug((c), "%s:%i: " fmt, __func__, \ + __LINE__ __VA_OPT__(,) __VA_ARGS__) #define verbose(fmt, ...) __ifdebug(DBG_VERBOSE, fmt, __VA_ARGS__) #define info(fmt, ...) __ifdebug(DBG_ERROR, fmt, __VA_ARGS__) -#define error(fmt, ...) __ifdebug(DBG_ERROR, fmt, __VA_ARGS__) +#define error(fmt, ...) __ifdebug(DBG_ERROR, "%s: " fmt, \ + __func__ __VA_OPT__(,) __VA_ARGS__) void __die(const char *fmt, ...) __attribute__((format(printf, 1, 2))); |