summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2007-09-18 20:17:43 +0000
committerotto <otto@openbsd.org>2007-09-18 20:17:43 +0000
commit36a68dd9e79d88e2c5ca480cb6d762450fa94411 (patch)
tree13e6c033bb90db9328666f10a647d4bcdacee728
parentpcc knows inline. ok kjell@ miod@ (diff)
downloadwireguard-openbsd-36a68dd9e79d88e2c5ca480cb6d762450fa94411.tar.xz
wireguard-openbsd-36a68dd9e79d88e2c5ca480cb6d762450fa94411.zip
As a temporary workaround, implement va_start not using
__builtin_next_arg for !GCC until pcc supports it. ok kjell@ miod@
-rw-r--r--sys/arch/i386/include/stdarg.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/i386/include/stdarg.h b/sys/arch/i386/include/stdarg.h
index 84fdf9b377b..ae9e0deb65f 100644
--- a/sys/arch/i386/include/stdarg.h
+++ b/sys/arch/i386/include/stdarg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdarg.h,v 1.10 2006/04/09 03:07:52 deraadt Exp $ */
+/* $OpenBSD: stdarg.h,v 1.11 2007/09/18 20:17:43 otto Exp $ */
/* $NetBSD: stdarg.h,v 1.12 1995/12/25 23:15:31 mycroft Exp $ */
/*-
@@ -45,10 +45,13 @@ typedef __va_list va_list;
#ifdef lint
#define va_start(ap,lastarg) ((ap) = (ap))
-#else
+#elif defined(__GCC__)
#define va_start(ap, last) \
((ap) = (va_list)__builtin_next_arg(last))
-#endif /* lint */
+#else
+#define va_start(ap, last) \
+ ((ap) = (va_list)&(last) + __va_size(last))
+#endif
#define va_arg(ap, type) \
(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))