AK: Don't bring in LibBareMetal's kstdio.h in userspace

This commit is contained in:
Andreas Kling 2020-02-15 19:18:56 +01:00
parent 7ec1b2e44b
commit f27a646bf5
Notes: sideshowbarker 2024-07-19 09:18:36 +09:00

View file

@ -27,10 +27,24 @@
#pragma once
#ifdef __serenity__
# if defined(KERNEL) || defined(BOOTSTRAPPER)
# include <LibBareMetal/Output/kstdio.h>
# else
# include <AK/Types.h>
extern "C" {
int dbgprintf(const char* fmt, ...);
int dbgputstr(const char*, int);
int sprintf(char* buf, const char* fmt, ...);
}
template<size_t N>
inline int dbgputstr(const char (&array)[N])
{
return ::dbgputstr(array, N);
}
# endif
#else
#include <stdio.h>
#define kprintf printf
#define dbgprintf printf
#define dbgputstr(characters, length) fwrite(characters, 1, length, stdout)
# include <stdio.h>
# define kprintf printf
# define dbgprintf printf
# define dbgputstr(characters, length) fwrite(characters, 1, length, stdout)
#endif