scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 545b4aacc0f5f08df8c2a75c77ef02287127c098
parent 46f4fcce1a9d9715786442d3dad0ee87d868923f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 12 Feb 2017 22:00:49 +0100

[libc] Add stdarg.h builtin for qbe and amd64

Diffstat:
Mlibc/include/amd64-sysv/stdarg.h | 7+++----
Alibc/include/qbe/stdarg.h | 10++++++++++
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/libc/include/amd64-sysv/stdarg.h b/libc/include/amd64-sysv/stdarg.h @@ -11,9 +11,8 @@ typedef struct { typedef __va_elem va_list[1]; -#define va_start(X, Y) __builtin_va_start((X), (Y)) -#define va_end(X) (X) - -int vfprintf(FILE *stream, const char *format, va_list ap); +#define va_start(ap, last) __builtin_va_start((ap), (last)) +#define va_end(ap) __builtin__va_end(ap) +#define va_copy(to, from) __builtin_va_copy((to), (from)) #endif diff --git a/libc/include/qbe/stdarg.h b/libc/include/qbe/stdarg.h @@ -0,0 +1,10 @@ +#ifndef _STDARG_H +#define _STDARG_H + +#define va_list __builtin_va_list +#define va_start(ap, last) __builtin_va_start((ap), (last)) +#define va_end(ap) __builtin_va_end((ap)) +#define va_copy(to, from) __builtin_va_copy((to), (from)) +#define va_arg(to, type) __builtin_va_arg((to), (type)) + +#endif