lib: Use GCC compatible stdarg.h for TINYCC.

* include/stdarg.h: Include __TINYC__ in the GCC style argument control
via __builtin* family.
This commit is contained in:
Ekaitz Zarraga 2023-10-09 00:51:17 +02:00 committed by Janneke Nieuwenhuizen
parent f49689d31a
commit 3539ee92a7

View file

@ -25,12 +25,13 @@
#undef __MES_STDARG_H #undef __MES_STDARG_H
#include_next <stdarg.h> #include_next <stdarg.h>
#define va_arg8(ap, type) va_arg(ap, type) #define va_arg8(ap, type) va_arg (ap, type)
#elif __GNUC__ && __riscv #elif (__GNUC__ || __TINYC__) && __riscv
// GCC on RISC-V always passes arguments in registers. Implementing // GCC on RISC-V always passes arguments in registers. Implementing
// these macros without the use of built-ins would be very involved. // these macros without the use of built-ins would be very involved.
// TINYCC tries to be GCC compatible in this case.
typedef __builtin_va_list va_list; typedef __builtin_va_list va_list;
#define va_start(v, l) __builtin_va_start (v, l) #define va_start(v, l) __builtin_va_start (v, l)