From f27a646bf5ecb6d0c4edc74627eacd2b19f82d2e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 15 Feb 2020 19:18:56 +0100 Subject: [PATCH] AK: Don't bring in LibBareMetal's kstdio.h in userspace --- AK/kstdio.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/AK/kstdio.h b/AK/kstdio.h index bca1051ba6..05b06365d8 100644 --- a/AK/kstdio.h +++ b/AK/kstdio.h @@ -27,10 +27,24 @@ #pragma once #ifdef __serenity__ -# include +# if defined(KERNEL) || defined(BOOTSTRAPPER) +# include +# else +# include +extern "C" { +int dbgprintf(const char* fmt, ...); +int dbgputstr(const char*, int); +int sprintf(char* buf, const char* fmt, ...); +} +template +inline int dbgputstr(const char (&array)[N]) +{ + return ::dbgputstr(array, N); +} +# endif #else -#include -#define kprintf printf -#define dbgprintf printf -#define dbgputstr(characters, length) fwrite(characters, 1, length, stdout) +# include +# define kprintf printf +# define dbgprintf printf +# define dbgputstr(characters, length) fwrite(characters, 1, length, stdout) #endif