shithub: scc

Download patch

ref: 1093e4c416c30a25ef1b424e289264ea5e6fc973
parent: 69fd68486ad58e08c0c2ffbff258f4dff50688fa
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Feb 12 17:00:49 EST 2017

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

--- a/libc/include/amd64-sysv/stdarg.h
+++ b/libc/include/amd64-sysv/stdarg.h
@@ -11,9 +11,8 @@
 
 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
--- /dev/null
+++ b/libc/include/qbe/stdarg.h
@@ -1,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