Skip to content

Commit cde8ed1

Browse files
committed
fixup! Change default behaviour of baremetal/printf to use stdout
1 parent 5616dad commit cde8ed1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libc/src/stdio/baremetal/printf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace LIBC_NAMESPACE_DECL {
2121

2222
namespace {
2323

24-
LIBC_INLINE int raw_write_stdout_hook(cpp::string_view new_str, void *) {
24+
LIBC_INLINE int stdout_write_hook(cpp::string_view new_str, void *) {
2525
write_to_stdout(new_str);
2626
return printf_core::WRITE_OK;
2727
}
@@ -39,7 +39,7 @@ LLVM_LIBC_FUNCTION(int, printf, (const char *__restrict format, ...)) {
3939
char buffer[BUFF_SIZE];
4040

4141
printf_core::WriteBuffer<printf_core::WriteMode::FLUSH_TO_STREAM> wb(
42-
buffer, BUFF_SIZE, &raw_write_stdout_hook, nullptr);
42+
buffer, BUFF_SIZE, &stdout_write_hook, nullptr);
4343
printf_core::Writer<printf_core::WriteMode::FLUSH_TO_STREAM> writer(wb);
4444

4545
int retval = printf_core::printf_main(&writer, format, args);

libc/src/stdio/baremetal/vprintf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace LIBC_NAMESPACE_DECL {
2121

2222
namespace {
2323

24-
LIBC_INLINE int raw_write_stdout_hook(cpp::string_view new_str, void *) {
24+
LIBC_INLINE int stdout_write_hook(cpp::string_view new_str, void *) {
2525
write_to_stdout(new_str);
2626
return printf_core::WRITE_OK;
2727
}
@@ -37,7 +37,7 @@ LLVM_LIBC_FUNCTION(int, vprintf,
3737
char buffer[BUFF_SIZE];
3838

3939
printf_core::WriteBuffer<printf_core::WriteMode::FLUSH_TO_STREAM> wb(
40-
buffer, BUFF_SIZE, &raw_write_stdout_hook, nullptr);
40+
buffer, BUFF_SIZE, &stdout_write_hook, nullptr);
4141
printf_core::Writer<printf_core::WriteMode::FLUSH_TO_STREAM> writer(wb);
4242

4343
int retval = printf_core::printf_main(&writer, format, args);

0 commit comments

Comments
 (0)