1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:28:11 +00:00

LibC: Add some things needed to build GNU bc.

This patch adds vprintf(), sig_atomic_t, random() and strdup().
bc doesn't build yet, but it will.
This commit is contained in:
Andreas Kling 2019-02-01 16:03:21 +01:00
parent feed67ede2
commit 76f53b40f4
6 changed files with 30 additions and 1 deletions

View file

@ -268,11 +268,16 @@ int fprintf(FILE* stream, const char* fmt, ...)
return ret;
}
int vprintf(const char* fmt, va_list ap)
{
return printf_internal(stdout_putch, nullptr, fmt, ap);
}
int printf(const char* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
int ret = printf_internal(stdout_putch, nullptr, fmt, ap);
int ret = vprintf(fmt, ap);
va_end(ap);
return ret;
}