Files

18 lines
647 B
C

#ifndef CONFORMANCE_STDARG_H
#define CONFORMANCE_STDARG_H
/* M6 general varargs: the target's va_list is the compiler's built-in
* downward stack walk (see scripts/m6/varargs-main.c). Keep these macros
* thin wrappers over the clang builtins so the va_arg type/ABI rules come
* from the target lowering, not from a header layout guess. */
typedef __builtin_va_list va_list;
#define va_start(ap, last) __builtin_va_start(ap, last)
#define va_arg(ap, type) __builtin_va_arg(ap, type)
#define va_end(ap) __builtin_va_end(ap)
#define va_copy(dst, src) __builtin_va_copy(dst, src)
#define __va_copy(dst, src) __builtin_va_copy(dst, src)
#endif