mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +00:00
AK: Remove kstdio.h and dbgputstr()
We can just write directly to stderr in the one place this was used.
This commit is contained in:
parent
6df5785fc4
commit
47287d2cf1
Notes:
sideshowbarker
2024-07-17 04:32:07 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/47287d2cf1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/197 Reviewed-by: https://github.com/ADKaster
3 changed files with 1 additions and 33 deletions
|
@ -12,7 +12,6 @@
|
|||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/StringFloatingPointConversions.h>
|
||||
#include <AK/kstdio.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -1210,7 +1209,7 @@ void vdbg(StringView fmtstr, TypeErasedFormatParams& params, bool newline)
|
|||
#ifdef AK_OS_ANDROID
|
||||
__android_log_write(ANDROID_LOG_DEBUG, s_log_tag_name, string.characters_without_null_termination());
|
||||
#else
|
||||
dbgputstr(string.characters_without_null_termination(), string.length());
|
||||
[[maybe_unused]] auto rc = write(STDERR_FILENO, string.characters_without_null_termination(), string.length());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
30
AK/kstdio.h
30
AK/kstdio.h
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Platform.h>
|
||||
|
||||
#ifdef AK_OS_SERENITY
|
||||
# include <AK/Types.h>
|
||||
# include <stdarg.h>
|
||||
extern "C" {
|
||||
void dbgputstr(char const*, size_t);
|
||||
int sprintf(char* buf, char const* fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||
int snprintf(char* buffer, size_t, char const* fmt, ...) __attribute__((format(printf, 3, 4)));
|
||||
}
|
||||
#else
|
||||
# include <stdio.h>
|
||||
inline void dbgputstr(char const* characters, size_t length)
|
||||
{
|
||||
fwrite(characters, 1, length, stderr);
|
||||
}
|
||||
#endif
|
||||
template<size_t N>
|
||||
inline void dbgputstr(char const (&array)[N])
|
||||
{
|
||||
return ::dbgputstr(array, N);
|
||||
}
|
|
@ -209,7 +209,6 @@ shared_library("AK") {
|
|||
"Weakable.h",
|
||||
"kmalloc.cpp",
|
||||
"kmalloc.h",
|
||||
"kstdio.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue