mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
More LibC portability work while trying to get figlet building.
This commit is contained in:
parent
bb90c8ecab
commit
9160fd0d47
12 changed files with 128 additions and 2 deletions
|
@ -20,6 +20,22 @@ static void sys_putch(char*&, char ch)
|
|||
putchar(ch);
|
||||
}
|
||||
|
||||
static FILE* __current_stream = nullptr;
|
||||
static void stream_putch(char*&, char ch)
|
||||
{
|
||||
write(__current_stream->fd, &ch, 1);
|
||||
}
|
||||
|
||||
int fprintf(FILE* fp, const char* fmt, ...)
|
||||
{
|
||||
__current_stream = fp;
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int ret = printfInternal(stream_putch, nullptr, fmt, ap);
|
||||
va_end(ap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int printf(const char* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue