summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrahn <drahn@openbsd.org>2002-10-24 16:59:24 +0000
committerdrahn <drahn@openbsd.org>2002-10-24 16:59:24 +0000
commit867a1f11d91e5f493895936c7f531368c3f63ea1 (patch)
treeb542982117658fbc00b68f1d5b09f80fbe364777
parentsync (diff)
downloadwireguard-openbsd-867a1f11d91e5f493895936c7f531368c3f63ea1.tar.xz
wireguard-openbsd-867a1f11d91e5f493895936c7f531368c3f63ea1.zip
Add va_copy() as necessary for powerpc, same protections as was added
recently on other architectures.
-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) = \