diff options
-rw-r--r-- | trace.c | 1 | ||||
-rw-r--r-- | trace.h | 8 |
2 files changed, 9 insertions, 0 deletions
@@ -10,6 +10,7 @@ enum pack_trace pack_trace = PACK_TRACE_OFF; +ATTRIBUTE_FORMAT(printf, 2, 0) static void trace(enum pack_trace level, const char *fmt, va_list va) { char *type; @@ -5,7 +5,15 @@ #ifndef PACK_TRACE_H #define PACK_TRACE_H +#ifdef DEVEL +#define ATTRIBUTE_FORMAT(type, fmt, args) __attribute__((format(type, fmt, args))) +#else +#define ATTRIBUTE_FORMAT(type, fmt, args) +#endif + +ATTRIBUTE_FORMAT(printf, 1, 2) void tr_call(const char *fmt, ...); +ATTRIBUTE_FORMAT(printf, 1, 2) void tr_debug(const char *fmt, ...); #endif // !PACK_TRACE_H |