Add a C99-style va_copy macro.
This commit is contained in:
parent
5b67628108
commit
82464e46d6
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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) */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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__
|
||||
|
|
|
@ -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_ */
|
||||
|
|
Loading…
Reference in New Issue