summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-01-03 01:46:11 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-01-03 01:46:11 +0000
commitde685fc21701359faaa3003015c377faba430dd1 (patch)
tree9f2d9549e55263824436473968511c1bea94218c /sys
parent5845663583e74c40975a6286b416d1fd470a103f (diff)
Provide a simple va_copy() implementation.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mvme88k/include/va-m88k.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/arch/mvme88k/include/va-m88k.h b/sys/arch/mvme88k/include/va-m88k.h
index c70f835f855..a53d4d71ed4 100644
--- a/sys/arch/mvme88k/include/va-m88k.h
+++ b/sys/arch/mvme88k/include/va-m88k.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: va-m88k.h,v 1.7 2002/03/25 19:40:30 miod Exp $ */
+/* $OpenBSD: va-m88k.h,v 1.8 2003/01/03 01:46:10 miod Exp $ */
/* This file has local changes by MOTOROLA
Thu Sep 9 09:06:29 CDT 1993 Dale Rahn (drahn@pacific)
@@ -64,4 +64,22 @@ typedef __va_list __gnuc_va_list;
#define va_end(AP)
+/* Copy __gnuc_va_list into another variable of this type. */
+#if __GNUC_MAJOR__ > 2 || __GNUC_MINOR > 8
+#define __va_copy(dest, src) \
+ __extension__ ({ \
+ (dest) = \
+ (__gnuc_va_list *)__builtin_alloca(sizeof(__gnuc_va_list)); \
+ *(dest) = *(src);\
+ })
+#else
+#define __va_copy(dest, src) *(dest) = *(src)
+#endif
+
+#if !defined(_ANSI_SOURCE) && \
+ (defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy(dest, src) __va_copy(dest, src)
+#endif
+
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */