summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-06-03 21:06:45 +0000
committerderaadt <deraadt@openbsd.org>1999-06-03 21:06:45 +0000
commit5c8eef7fa8862a7eb78e99b0d3f911b143605868 (patch)
tree3183fa922c0b033837c0380cd3c1c6b12cd5678a
parentadd support for including the subject of a message being replied to (diff)
downloadwireguard-openbsd-5c8eef7fa8862a7eb78e99b0d3f911b143605868.tar.xz
wireguard-openbsd-5c8eef7fa8862a7eb78e99b0d3f911b143605868.zip
use __builtin_next_arg() for va_start()
-rw-r--r--sys/arch/i386/include/stdarg.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/arch/i386/include/stdarg.h b/sys/arch/i386/include/stdarg.h
index ddf7c81c083..204fd1cca87 100644
--- a/sys/arch/i386/include/stdarg.h
+++ b/sys/arch/i386/include/stdarg.h
@@ -45,8 +45,13 @@ typedef _BSD_VA_LIST_ va_list;
#define __va_size(type) \
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
+#ifdef __GNUC__
+#define va_start(ap, last) \
+ ((ap) = (va_list)__builtin_next_arg(last))
+#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)))