Add a pcc version of stdarg.
authorDavid Given <dg@cowlark.com>
Sat, 3 Sep 2016 21:39:12 +0000 (23:39 +0200)
committerDavid Given <dg@cowlark.com>
Sat, 3 Sep 2016 21:39:12 +0000 (23:39 +0200)
--HG--
branch : default-branch

lang/cem/libcc.ansi/headers/stdarg.h

index 6442b7f..5ba43e7 100644 (file)
@@ -9,6 +9,19 @@
 #ifndef _STDARG_H
 #define        _STDARG_H
 
+#if defined(__PCC__)
+
+/* This only works on pcc architectures. */
+
+typedef __builtin_va_list va_list;
+#define va_start(v, l) __builtin_va_start(v, l)
+#define va_end(v)      __builtin_va_end(v)
+#define va_arg(v, l)   __builtin_va_arg(v, l)
+
+#else
+
+/* ...and this only works on EM architectures. */
+
 typedef char* va_list;
 
 #define __vasz(x)              ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int) -1))
@@ -18,3 +31,5 @@ typedef char* va_list;
 #define va_end(ap)
 
 #endif
+
+#endif