diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/printf.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kern/printf.h b/kern/printf.h index 1383198..c5effe5 100644 --- a/kern/printf.h +++ b/kern/printf.h @@ -43,6 +43,15 @@ extern int sprintf (char *buf, const char *fmt, ...); extern int printf (const char *fmt, ...); +#define printf_once(fmt, ...) \ + MACRO_BEGIN \ + static int __once = 0; \ + if (!__once) { \ + printf(fmt, ##__VA_ARGS__); \ + __once = 1; \ + } \ + MACRO_END + extern int indent; extern void iprintf (const char *fmt, ...); |