mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
AK: Don't bring in LibBareMetal's kstdio.h in userspace
This commit is contained in:
parent
7ec1b2e44b
commit
f27a646bf5
Notes:
sideshowbarker
2024-07-19 09:18:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f27a646bf5e
1 changed files with 19 additions and 5 deletions
22
AK/kstdio.h
22
AK/kstdio.h
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue