diff options
| author | kleink <kleink@NetBSD.org> | 2000-02-03 16:16:06 +0000 |
|---|---|---|
| committer | kleink <kleink@NetBSD.org> | 2000-02-03 16:16:06 +0000 |
| commit | 82464e46d67d0ecd281d5eebfdea43bcbd798ddb (patch) | |
| tree | 17422fbd248fd6c9196ccf13a96647fd5965acf4 /sys | |
| parent | 5b676281088d90e0005ced1a16e9c9e7c1b79d54 (diff) | |
Add a C99-style va_copy macro.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/alpha/include/stdarg.h | 10 | ||||
| -rw-r--r-- | sys/arch/arm32/include/stdarg.h | 10 | ||||
| -rw-r--r-- | sys/arch/i386/include/stdarg.h | 10 | ||||
| -rw-r--r-- | sys/arch/m68k/include/stdarg.h | 10 | ||||
| -rw-r--r-- | sys/arch/mips/include/stdarg.h | 10 | ||||
| -rw-r--r-- | sys/arch/pc532/include/stdarg.h | 10 | ||||
| -rw-r--r-- | sys/arch/powerpc/include/stdarg.h | 9 | ||||
| -rw-r--r-- | sys/arch/powerpc/include/va-ppc.h | 5 | ||||
| -rw-r--r-- | sys/arch/powerpc/include/varargs.h | 9 | ||||
| -rw-r--r-- | sys/arch/sh3/include/stdarg.h | 9 | ||||
| -rw-r--r-- | sys/arch/sh3/include/varargs.h | 9 | ||||
| -rw-r--r-- | sys/arch/sparc/include/stdarg.h | 10 | ||||
| -rw-r--r-- | sys/arch/sparc64/include/stdarg.h | 10 | ||||
| -rw-r--r-- | sys/arch/vax/include/stdarg.h | 10 |
14 files changed, 117 insertions, 14 deletions
diff --git a/sys/arch/alpha/include/stdarg.h b/sys/arch/alpha/include/stdarg.h index d865735e939..b9a5c64316c 100644 --- a/sys/arch/alpha/include/stdarg.h +++ b/sys/arch/alpha/include/stdarg.h @@ -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 @@ 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) #endif /* !_ALPHA_STDARG_H_ */ diff --git a/sys/arch/arm32/include/stdarg.h b/sys/arch/arm32/include/stdarg.h index a68b537e928..6749a79cec4 100644 --- a/sys/arch/arm32/include/stdarg.h +++ b/sys/arch/arm32/include/stdarg.h @@ -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 @@ typedef _BSD_VA_LIST_ va_list; (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 --git a/sys/arch/i386/include/stdarg.h b/sys/arch/i386/include/stdarg.h index 8a34050d4a8..485444680bb 100644 --- a/sys/arch/i386/include/stdarg.h +++ b/sys/arch/i386/include/stdarg.h @@ -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 @@ 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 /* !_I386_STDARG_H_ */ diff --git a/sys/arch/m68k/include/stdarg.h b/sys/arch/m68k/include/stdarg.h index 628e8905731..3915cde5547 100644 --- a/sys/arch/m68k/include/stdarg.h +++ b/sys/arch/m68k/include/stdarg.h @@ -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 @@ 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) #endif /* !_M68K_STDARG_H_ */ diff --git a/sys/arch/mips/include/stdarg.h b/sys/arch/mips/include/stdarg.h index 7181e85bc7b..246e3d9223f 100644 --- a/sys/arch/mips/include/stdarg.h +++ b/sys/arch/mips/include/stdarg.h @@ -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 @@ typedef _BSD_VA_LIST_ va_list; ))[-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 --git a/sys/arch/pc532/include/stdarg.h b/sys/arch/pc532/include/stdarg.h index 2a715f257cc..de919d7f564 100644 --- a/sys/arch/pc532/include/stdarg.h +++ b/sys/arch/pc532/include/stdarg.h @@ -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 @@ 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 /* !_PC532_STDARG_H_ */ diff --git a/sys/arch/powerpc/include/stdarg.h b/sys/arch/powerpc/include/stdarg.h index b7883c78585..87b116c5695 100644 --- a/sys/arch/powerpc/include/stdarg.h +++ b/sys/arch/powerpc/include/stdarg.h @@ -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 --git a/sys/arch/powerpc/include/va-ppc.h b/sys/arch/powerpc/include/va-ppc.h index 61ecb629d69..c4387eea943 100644 --- a/sys/arch/powerpc/include/va-ppc.h +++ b/sys/arch/powerpc/include/va-ppc.h @@ -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 @@ __extension__ ({ \ __ptr; \ }))) +#define __va_copy(dest, src) \ + (*(dest) = *(src)) + #define va_end(AP) ((void)0) #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/sys/arch/powerpc/include/varargs.h b/sys/arch/powerpc/include/varargs.h index 24f37a60ad0..b77bd98432a 100644 --- a/sys/arch/powerpc/include/varargs.h +++ b/sys/arch/powerpc/include/varargs.h @@ -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 @@ typedef __gnuc_va_list va_list; #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 --git a/sys/arch/sh3/include/stdarg.h b/sys/arch/sh3/include/stdarg.h index 56ce760e0a9..81bb2810559 100644 --- a/sys/arch/sh3/include/stdarg.h +++ b/sys/arch/sh3/include/stdarg.h @@ -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 --git a/sys/arch/sh3/include/varargs.h b/sys/arch/sh3/include/varargs.h index c8da13c8d0c..619b3f2e639 100644 --- a/sys/arch/sh3/include/varargs.h +++ b/sys/arch/sh3/include/varargs.h @@ -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) || \ + defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L) +#define va_copy __va_copy +#endif + #endif /* _SH3_VARARGS_H_ */ diff --git a/sys/arch/sparc/include/stdarg.h b/sys/arch/sparc/include/stdarg.h index feb28c9f40c..287583b2730 100644 --- a/sys/arch/sparc/include/stdarg.h +++ b/sys/arch/sparc/include/stdarg.h @@ -1,4 +1,4 @@ -/* $NetBSD: stdarg.h,v 1.15 1999/05/04 13:36:10 christos Exp $ */ +/* $NetBSD: stdarg.h,v 1.16 2000/02/03 16:16:10 kleink Exp $ */ /* * Copyright (c) 1992, 1993 @@ -48,6 +48,7 @@ #define _SPARC_STDARG_H_ #include <machine/ansi.h> +#include <sys/featuretest.h> typedef _BSD_VA_LIST_ va_list; @@ -106,6 +107,13 @@ typedef _BSD_VA_LIST_ va_list; __va_8byte(ap, type) : __va_arg(ap, type)) #endif /* __lint__ */ +#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 /* !_SPARC_STDARG_H_ */ diff --git a/sys/arch/sparc64/include/stdarg.h b/sys/arch/sparc64/include/stdarg.h index e8c3dcb38d3..259f45bd4be 100644 --- a/sys/arch/sparc64/include/stdarg.h +++ b/sys/arch/sparc64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $NetBSD: stdarg.h,v 1.8 1999/05/04 13:36:44 christos Exp $ */ +/* $NetBSD: stdarg.h,v 1.9 2000/02/03 16:16:10 kleink Exp $ */ /* * Copyright (c) 1992, 1993 @@ -48,6 +48,7 @@ #define _SPARC64_STDARG_H_ #include <machine/ansi.h> +#include <sys/featuretest.h> #ifdef __lint__ #define __builtin_saveregs(t) (0) @@ -60,6 +61,13 @@ typedef _BSD_VA_LIST_ va_list; #define va_start(ap, last) \ (__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs()) +#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) #ifdef __arch64__ diff --git a/sys/arch/vax/include/stdarg.h b/sys/arch/vax/include/stdarg.h index 963f086df08..1a5e7c293f7 100644 --- a/sys/arch/vax/include/stdarg.h +++ b/sys/arch/vax/include/stdarg.h @@ -1,4 +1,4 @@ -/* $NetBSD: stdarg.h,v 1.11 1999/05/03 16:30:34 christos Exp $ */ +/* $NetBSD: stdarg.h,v 1.12 2000/02/03 16:16:11 kleink Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -39,6 +39,7 @@ #define _VAX_STDARG_H_ #include <machine/ansi.h> +#include <sys/featuretest.h> typedef _BSD_VA_LIST_ va_list; @@ -55,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_ */ |
