debug.h: add __attribute__ to debug(), for printf() args style
This commit is contained in:
18
c/debug.h
18
c/debug.h
@@ -19,22 +19,26 @@
|
||||
|
||||
#include "bits.h"
|
||||
|
||||
#define _unused __attribute__((__unused__))
|
||||
#define _printf __attribute__ ((format (printf, 6, 7)))
|
||||
#ifdef DEBUG_DEBUG
|
||||
#define _printf __attribute__ ((format (printf, 6, 7)))
|
||||
void debug_init(u32 level);
|
||||
void debug_level_set(u32 level);
|
||||
void debug_devel_set(u32 level);
|
||||
void debug(u32 level, bool timestamp, u32 indent,
|
||||
const char *src, u32 line, const char *, ...);
|
||||
void _printf debug(u32 level, bool timestamp,
|
||||
u32 indent, const char *src,
|
||||
u32 line, const char *, ...);
|
||||
#else /* DEBUG_DEBUG */
|
||||
#define _unused __attribute__((__unused__))
|
||||
static inline void debug_init(_unused u32 level) {}
|
||||
static inline void debug_level_set(_unused u32 level) {}
|
||||
static inline void debug_devel_set(_unused u32 level) {}
|
||||
static inline void debug(_unused u32 level, _unused bool timestamp,
|
||||
_unused u32 indent, _unused const char *src,
|
||||
_unused u32 line, const char *, ...) {}
|
||||
#undef _unused
|
||||
static inline void _printf debug(_unused u32 level, _unused bool timestamp,
|
||||
_unused u32 indent, _unused const char *src,
|
||||
_unused u32 line, const char *, ...) {}
|
||||
#endif /* DEBUG_DEBUG */
|
||||
#undef _unused
|
||||
#undef _printf
|
||||
|
||||
/* format: only printf
|
||||
*/
|
||||
|
Reference in New Issue
Block a user