Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Add a C99-style va_copy macro.
details: https://anonhg.NetBSD.org/src/rev/d2c2e2e8e9cb
branches: trunk
changeset: 481670:d2c2e2e8e9cb
user: kleink <kleink%NetBSD.org@localhost>
date: Thu Feb 03 16:16:06 2000 +0000
description:
Add a C99-style va_copy macro.
diffstat:
sys/arch/alpha/include/stdarg.h | 10 +++++++++-
sys/arch/arm32/include/stdarg.h | 10 +++++++++-
sys/arch/i386/include/stdarg.h | 10 +++++++++-
sys/arch/m68k/include/stdarg.h | 10 +++++++++-
sys/arch/mips/include/stdarg.h | 10 +++++++++-
sys/arch/pc532/include/stdarg.h | 10 +++++++++-
sys/arch/powerpc/include/stdarg.h | 9 ++++++++-
sys/arch/powerpc/include/va-ppc.h | 5 ++++-
sys/arch/powerpc/include/varargs.h | 9 ++++++++-
sys/arch/sh3/include/stdarg.h | 9 ++++++++-
sys/arch/sh3/include/varargs.h | 9 ++++++++-
sys/arch/sparc/include/stdarg.h | 10 +++++++++-
sys/arch/sparc64/include/stdarg.h | 10 +++++++++-
sys/arch/vax/include/stdarg.h | 10 +++++++++-
14 files changed, 117 insertions(+), 14 deletions(-)
diffs (truncated from 398 to 300 lines):
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/alpha/include/stdarg.h
--- a/sys/arch/alpha/include/stdarg.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/alpha/include/stdarg.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: stdarg.h,v 1.9 1999/05/03 16:30:31 christos Exp $ */
+/* $NetBSD: stdarg.h,v 1.10 2000/02/03 16:16:06 kleink Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,6 +39,7 @@
#define _ALPHA_STDARG_H_
#include <machine/ansi.h>
+#include <sys/featuretest.h>
#ifdef __lint__
#define __builtin_saveregs() (0)
@@ -63,6 +64,13 @@
(*(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)
#endif /* !_ALPHA_STDARG_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/arm32/include/stdarg.h
--- a/sys/arch/arm32/include/stdarg.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/arm32/include/stdarg.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: stdarg.h,v 1.7 1999/05/07 00:28:22 thorpej Exp $ */
+/* $NetBSD: stdarg.h,v 1.8 2000/02/03 16:16:06 kleink Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -39,6 +39,7 @@
#define _ARM32_STDARG_H_
#include <machine/ansi.h>
+#include <sys/featuretest.h>
typedef _BSD_VA_LIST_ va_list;
#ifdef __lint__
@@ -60,6 +61,13 @@
(abort(), 0) : sizeof(type)))[-1]
#endif
+#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 /* !_ARM32_STDARG_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/i386/include/stdarg.h
--- a/sys/arch/i386/include/stdarg.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/i386/include/stdarg.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: stdarg.h,v 1.16 1999/05/03 16:30:32 christos Exp $ */
+/* $NetBSD: stdarg.h,v 1.17 2000/02/03 16:16:07 kleink Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,6 +39,7 @@
#define _I386_STDARG_H_
#include <machine/ansi.h>
+#include <sys/featuretest.h>
typedef _BSD_VA_LIST_ va_list;
@@ -55,6 +56,13 @@
#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 /* !_I386_STDARG_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/m68k/include/stdarg.h
--- a/sys/arch/m68k/include/stdarg.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/m68k/include/stdarg.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: stdarg.h,v 1.18 1999/05/04 13:57:20 christos Exp $ */
+/* $NetBSD: stdarg.h,v 1.19 2000/02/03 16:16:07 kleink Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,6 +39,7 @@
#define _M68K_STDARG_H_
#include <machine/ansi.h>
+#include <sys/featuretest.h>
typedef _BSD_VA_LIST_ va_list;
@@ -58,6 +59,13 @@
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)
#endif /* !_M68K_STDARG_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/mips/include/stdarg.h
--- a/sys/arch/mips/include/stdarg.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/mips/include/stdarg.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: stdarg.h,v 1.17 1999/06/08 00:46:38 nisimura Exp $ */
+/* $NetBSD: stdarg.h,v 1.18 2000/02/03 16:16:07 kleink Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -39,6 +39,7 @@
#define _MIPS_STDARG_H_
#include <machine/ansi.h>
+#include <sys/featuretest.h>
typedef _BSD_VA_LIST_ va_list;
@@ -64,6 +65,13 @@
))[-1])
#endif
+#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 /* !_MIPS_STDARG_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/pc532/include/stdarg.h
--- a/sys/arch/pc532/include/stdarg.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/pc532/include/stdarg.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: stdarg.h,v 1.15 1999/05/03 16:30:34 christos Exp $ */
+/* $NetBSD: stdarg.h,v 1.16 2000/02/03 16:16:08 kleink Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,6 +39,7 @@
#define _PC532_STDARG_H_
#include <machine/ansi.h>
+#include <sys/featuretest.h>
typedef _BSD_VA_LIST_ va_list;
@@ -55,6 +56,13 @@
#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 /* !_PC532_STDARG_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/powerpc/include/stdarg.h
--- a/sys/arch/powerpc/include/stdarg.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/powerpc/include/stdarg.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,9 +1,10 @@
-/* $NetBSD: stdarg.h,v 1.3 1998/12/02 14:23:03 tsubai Exp $ */
+/* $NetBSD: stdarg.h,v 1.4 2000/02/03 16:16:08 kleink Exp $ */
#ifndef _PPC_STDARG_H_
#define _PPC_STDARG_H_
#include <machine/ansi.h>
+#include <sys/featuretest.h>
#ifndef _STDARG_H
#define _STDARG_H
@@ -12,4 +13,10 @@
typedef __gnuc_va_list va_list;
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy __va_copy
+#endif
+
#endif /* ! _PPC_STDARG_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/powerpc/include/va-ppc.h
--- a/sys/arch/powerpc/include/va-ppc.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/powerpc/include/va-ppc.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: va-ppc.h,v 1.4 1998/12/02 14:23:03 tsubai Exp $ */
+/* $NetBSD: va-ppc.h,v 1.5 2000/02/03 16:16:09 kleink Exp $ */
/* GNU C varargs support for the PowerPC with V.4 calling sequence */
@@ -152,6 +152,9 @@
__ptr; \
})))
+#define __va_copy(dest, src) \
+ (*(dest) = *(src))
+
#define va_end(AP) ((void)0)
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/powerpc/include/varargs.h
--- a/sys/arch/powerpc/include/varargs.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/powerpc/include/varargs.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,9 +1,10 @@
-/* $NetBSD: varargs.h,v 1.3 1998/12/02 14:23:03 tsubai Exp $ */
+/* $NetBSD: varargs.h,v 1.4 2000/02/03 16:16:09 kleink Exp $ */
#ifndef _PPC_VARARGS_H_
#define _PPC_VARARGS_H_
#include <machine/ansi.h>
+#include <sys/featuretest.h>
#ifndef _VARARGS_H
#define _VARARGS_H
@@ -14,4 +15,10 @@
#undef _BSD_VA_LIST
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy __va_copy
+#endif
+
#endif /* ! _PPC_VARARGS_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/sh3/include/stdarg.h
--- a/sys/arch/sh3/include/stdarg.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/sh3/include/stdarg.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: stdarg.h,v 1.2 1999/09/16 12:48:06 msaitoh Exp $ */
+/* $NetBSD: stdarg.h,v 1.3 2000/02/03 16:16:10 kleink Exp $ */
#ifndef _SH3_STDARG_H_
#define _SH3_STDARG_H_
@@ -6,7 +6,14 @@
#define _STDARG_H
#include "sh3/va-sh.h"
+#include <sys/featuretest.h>
typedef __gnuc_va_list va_list;
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
+#define va_copy __va_copy
+#endif
+
#endif /* _SH3_STDARG_H_ */
diff -r c3ae1afeecf7 -r d2c2e2e8e9cb sys/arch/sh3/include/varargs.h
--- a/sys/arch/sh3/include/varargs.h Thu Feb 03 13:58:55 2000 +0000
+++ b/sys/arch/sh3/include/varargs.h Thu Feb 03 16:16:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: varargs.h,v 1.2 1999/09/16 12:48:06 msaitoh Exp $ */
+/* $NetBSD: varargs.h,v 1.3 2000/02/03 16:16:10 kleink Exp $ */
#ifndef _SH3_VARARGS_H_
#define _SH3_VARARGS_H_
@@ -6,7 +6,14 @@
#define _VARARGS_H
#include "sh3/va-sh.h"
+#include <sys/featuretest.h>
typedef __gnuc_va_list va_list;
+#if !defined(_ANSI_SOURCE) && \
+ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
Home |
Main Index |
Thread Index |
Old Index