[hackers] [scc] [libc] Add stdarg.h builtin for qbe and amd64 || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sun, 12 Feb 2017 22:01:53 +0100 (CET)

commit 545b4aacc0f5f08df8c2a75c77ef02287127c098
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sun Feb 12 22:00:49 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sun Feb 12 22:00:49 2017 +0100

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

diff --git a/libc/include/amd64-sysv/stdarg.h b/libc/include/amd64-sysv/stdarg.h
index bde8c75..728aa14 100644
--- a/libc/include/amd64-sysv/stdarg.h
+++ b/libc/include/amd64-sysv/stdarg.h
_AT_@ -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
new file mode 100644
index 0000000..27d05c3
--- /dev/null
+++ b/libc/include/qbe/stdarg.h
_AT_@ -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
Received on Sun Feb 12 2017 - 22:01:53 CET

This archive was generated by hypermail 2.3.0 : Sun Feb 12 2017 - 22:12:16 CET