summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-10-23 15:38:17 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-10-23 15:38:17 +0000
commit212dd804bd51ed406b546164f1c7e90f484f8a4f (patch)
treecbcebdfa61bb9145f06d8d9f9eff646d8447a579
parent95ae11115c4c9ec9f867fa2f73df1c4428a5c4ab (diff)
Add a trivial va_copy() macro to all architectures but powerpc
(which I will leave for Dale since it needs special handling). From NetBSD (and same as sparc64). espie@ OK
-rw-r--r--sys/arch/alpha/include/stdarg.h9
-rw-r--r--sys/arch/hppa/include/stdarg.h9
-rw-r--r--sys/arch/i386/include/stdarg.h9
-rw-r--r--sys/arch/m68k/include/stdarg.h9
-rw-r--r--sys/arch/sparc/include/stdarg.h9
-rw-r--r--sys/arch/vax/include/stdarg.h9
6 files changed, 48 insertions, 6 deletions
diff --git a/sys/arch/alpha/include/stdarg.h b/sys/arch/alpha/include/stdarg.h
index 6d3b043d87c..db4c584eaa1 100644
--- a/sys/arch/alpha/include/stdarg.h
+++ b/sys/arch/alpha/include/stdarg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdarg.h,v 1.4 1996/10/30 22:39:30 niklas Exp $ */
+/* $OpenBSD: stdarg.h,v 1.5 2002/10/23 15:38:15 millert Exp $ */
/* $NetBSD: stdarg.h,v 1.4 1996/10/09 21:13:05 cgd Exp $ */
/*-
@@ -58,6 +58,13 @@ typedef _BSD_VA_LIST_ va_list;
(*(type *)((ap).offset += __va_size(type), \
(ap).base + (ap).offset + __va_arg_offset(ap, type)))
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy(dest, src) \
+ ((dest) = (src))
+#endif
+
#define va_end(ap) ((void)0)
#endif /* !_ALPHA_STDARG_H_ */
diff --git a/sys/arch/hppa/include/stdarg.h b/sys/arch/hppa/include/stdarg.h
index fc4cfda185c..b9a05a08956 100644
--- a/sys/arch/hppa/include/stdarg.h
+++ b/sys/arch/hppa/include/stdarg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdarg.h,v 1.2 1998/11/23 03:28:23 mickey Exp $ */
+/* $OpenBSD: stdarg.h,v 1.3 2002/10/23 15:38:15 millert Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -54,6 +54,13 @@ typedef double *va_list;
(sizeof(type) > 4 ? ~0x7 : ~0x3))),\
(*((type *) (void *) ((char *)ap + ((8 - sizeof(type)) % 4))))))
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy(dest, src) \
+ ((dest) = (src))
+#endif
+
#define va_end(ap)
#endif /* !_MACHINE_STDARG_H */
diff --git a/sys/arch/i386/include/stdarg.h b/sys/arch/i386/include/stdarg.h
index 4a9a312a3ca..fa2df68e726 100644
--- a/sys/arch/i386/include/stdarg.h
+++ b/sys/arch/i386/include/stdarg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdarg.h,v 1.4 2000/08/05 22:07:33 niklas Exp $ */
+/* $OpenBSD: stdarg.h,v 1.5 2002/10/23 15:38:15 millert Exp $ */
/* $NetBSD: stdarg.h,v 1.12 1995/12/25 23:15:31 mycroft Exp $ */
/*-
@@ -57,6 +57,13 @@ typedef _BSD_VA_LIST_ va_list;
#define va_arg(ap, type) \
(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy(dest, src) \
+ ((dest) = (src))
+#endif
+
#define va_end(ap) ((void)0)
#endif /* !_I386_STDARG_H_ */
diff --git a/sys/arch/m68k/include/stdarg.h b/sys/arch/m68k/include/stdarg.h
index c3499057e4d..03072675a0f 100644
--- a/sys/arch/m68k/include/stdarg.h
+++ b/sys/arch/m68k/include/stdarg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdarg.h,v 1.4 1999/06/03 21:13:45 downsj Exp $ */
+/* $OpenBSD: stdarg.h,v 1.5 2002/10/23 15:38:15 millert Exp $ */
/* $NetBSD: stdarg.h,v 1.14 1995/12/25 23:15:33 mycroft Exp $ */
/*-
@@ -60,6 +60,13 @@ typedef _BSD_VA_LIST_ va_list;
sizeof(type) != __va_size(type) ? \
sizeof(type) : __va_size(type))))
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy(dest, src) \
+ ((dest) = (src))
+#endif
+
#define va_end(ap) ((void)0)
#endif /* !_M68K_STDARG_H_ */
diff --git a/sys/arch/sparc/include/stdarg.h b/sys/arch/sparc/include/stdarg.h
index 311ec168f3f..8647edb1fc8 100644
--- a/sys/arch/sparc/include/stdarg.h
+++ b/sys/arch/sparc/include/stdarg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdarg.h,v 1.4 1997/08/08 08:26:50 downsj Exp $ */
+/* $OpenBSD: stdarg.h,v 1.5 2002/10/23 15:38:16 millert Exp $ */
/* $NetBSD: stdarg.h,v 1.10 1996/12/27 20:55:28 pk Exp $ */
/*
@@ -107,6 +107,13 @@ typedef _BSD_VA_LIST_ va_list;
*__va_arg(ap, type *) : __va_size(type) == 8 ? \
__va_8byte(ap, type) : __va_arg(ap, type))
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy(dest, src) \
+ ((dest) = (src))
+#endif
+
#define va_end(ap) ((void)0)
#endif /* !_SPARC_STDARG_H_ */
diff --git a/sys/arch/vax/include/stdarg.h b/sys/arch/vax/include/stdarg.h
index 97d3cdce40f..f647fafff16 100644
--- a/sys/arch/vax/include/stdarg.h
+++ b/sys/arch/vax/include/stdarg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdarg.h,v 1.4 2000/04/26 03:08:42 bjc Exp $ */
+/* $OpenBSD: stdarg.h,v 1.5 2002/10/23 15:38:16 millert Exp $ */
/* $NetBSD: stdarg.h,v 1.11 1999/05/03 16:30:34 christos Exp $ */
/*-
@@ -56,6 +56,13 @@ typedef _BSD_VA_LIST_ va_list;
#define va_arg(ap, type) \
(*(type *)(void *)((ap) += __va_size(type), (ap) - __va_size(type)))
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy(dest, src) \
+ ((dest) = (src))
+#endif
+
#define va_end(ap)
#endif /* !_VAX_STDARG_H_ */