Support va_args in libc-builtin (#1117)

Implement vprintf/sprintf/snprintf wrapper functions for libc-builtin.
This commit is contained in:
Xu Jun
2022-04-24 10:39:18 +08:00
committed by GitHub
parent 9b858c43cb
commit 5ab368dd00
3 changed files with 33 additions and 0 deletions

View File

@ -1067,6 +1067,9 @@ static NativeSymbol native_symbols_libc_builtin[] = {
REG_NATIVE_FUNC(printf, "($*)i"),
REG_NATIVE_FUNC(sprintf, "($$*)i"),
REG_NATIVE_FUNC(snprintf, "(*~$*)i"),
{ "vprintf", printf_wrapper, "($*)i", NULL },
{ "vsprintf", sprintf_wrapper, "($$*)i", NULL },
{ "vsnprintf", snprintf_wrapper, "(*~$*)i", NULL },
REG_NATIVE_FUNC(puts, "($)i"),
REG_NATIVE_FUNC(putchar, "(i)i"),
REG_NATIVE_FUNC(memcmp, "(**~)i"),