banan-os/libc/stdio/putchar.cpp

18 lines
234 B
C++
Raw Normal View History

#include <stdio.h>
#if defined(__is_libk)
#include <kernel/tty.h>
2022-11-14 00:27:11 +02:00
#else
#include <stdlib.h>
#endif
int putchar(int c)
{
#if defined(__is_libk)
char ch = (char)c;
terminal_write(&ch, sizeof(ch));
#else
2022-11-14 00:27:11 +02:00
abort();
#endif
return c;
}