summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-10-24 16:59:25 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-10-24 16:59:25 +0000
commit5dfe1978df640fe5f7b95133a7fea9c57c6e21cb (patch)
treec7441c38b10ec1c8a7e19613228f0fb8b2701b44 /sys/arch
parent45dd3aa13b8a3025997c892898770d3e4818c4d1 (diff)
Add va_copy() as necessary for powerpc, same protections as was added
recently on other architectures.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/powerpc/include/va-ppc.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/arch/powerpc/include/va-ppc.h b/sys/arch/powerpc/include/va-ppc.h
index c950186e9a8..1da4b3dadae 100644
--- a/sys/arch/powerpc/include/va-ppc.h
+++ b/sys/arch/powerpc/include/va-ppc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: va-ppc.h,v 1.9 2002/10/17 15:15:04 drahn Exp $ */
+/* $OpenBSD: va-ppc.h,v 1.10 2002/10/24 16:59:24 drahn Exp $ */
/* GNU C varargs support for the PowerPC with either the V.4 or Windows NT calling sequences */
#ifndef _WIN32
@@ -197,6 +197,17 @@ __extension__ (*({ \
#define va_end(AP) ((void)0)
/* Copy __gnuc_va_list into another variable of this type. */
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy(dest, src) \
+__extension__ ({ \
+ (dest) = \
+ (struct __va_list_tag *)__builtin_alloca(sizeof(__gnuc_va_list)); \
+ *(dest) = *(src);\
+ })
+#endif
+
#define __va_copy(dest, src) \
__extension__ ({ \
(dest) = \