Implement C99's va_copy() macro.
This commit is contained in:
parent
397f4349cf
commit
e35c51c74c
@ -71,7 +71,7 @@ MLINKS+=queue.3 TAILQ_PREV.3
|
||||
MLINKS+=queue.3 TAILQ_REMOVE.3
|
||||
|
||||
MLINKS+=stdarg.3 varargs.3 stdarg.3 va_arg.3 stdarg.3 va_end.3
|
||||
MLINKS+=stdarg.3 va_start.3
|
||||
MLINKS+=stdarg.3 va_copy.3 stdarg.3 va_start.3
|
||||
|
||||
MLINKS+=timeradd.3 timersub.3 timeradd.3 timerclear.3 timeradd.3 timerisset.3
|
||||
MLINKS+=timeradd.3 timercmp.3
|
||||
|
@ -36,7 +36,7 @@
|
||||
.\" @(#)stdarg.3 8.1 (Berkeley) 6/5/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 5, 1993
|
||||
.Dd September 18, 2002
|
||||
.Dt STDARG 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -49,6 +49,8 @@
|
||||
.Ft type
|
||||
.Fn va_arg "va_list ap" type
|
||||
.Ft void
|
||||
.Fn va_copy "va_list dest" "va_list src"
|
||||
.Ft void
|
||||
.Fn va_end "va_list ap"
|
||||
.Sh DESCRIPTION
|
||||
A function may be called with a varying number of arguments of varying
|
||||
@ -132,6 +134,27 @@ Successive invocations return the values of the remaining
|
||||
arguments.
|
||||
.Pp
|
||||
The
|
||||
.Fn va_copy
|
||||
macro copies a variable argument list, previously initialized by
|
||||
.Fn va_start ,
|
||||
from
|
||||
.Va src
|
||||
to
|
||||
.Va dest .
|
||||
The state is preserved such that it is equivalent to calling
|
||||
.Fn va_start
|
||||
with the same second argument used with
|
||||
.Va src ,
|
||||
and calling
|
||||
.Fn va_arg
|
||||
the same number of times as called with
|
||||
.Va src .
|
||||
.Pp
|
||||
The
|
||||
.Fn va_copy
|
||||
macro returns no value.
|
||||
.Pp
|
||||
The
|
||||
.Fn va_end
|
||||
macro handles a normal return from the function whose variable argument
|
||||
list was initialized by
|
||||
|
@ -51,6 +51,9 @@ typedef __va_list va_list;
|
||||
#define va_arg(ap, type) \
|
||||
__builtin_va_arg((ap), type)
|
||||
|
||||
#define va_copy(dest, src) \
|
||||
__builtin_va_copy((dest), (src))
|
||||
|
||||
#define va_end(ap) \
|
||||
__builtin_va_end(ap)
|
||||
|
||||
|
@ -41,6 +41,9 @@ typedef __va_list va_list;
|
||||
#define va_arg(ap, type) \
|
||||
__builtin_va_arg((ap), type)
|
||||
|
||||
#define va_copy(dest, src) \
|
||||
__builtin_va_copy((dest), (src))
|
||||
|
||||
#define va_end(ap) \
|
||||
__builtin_va_end(ap)
|
||||
|
||||
|
@ -50,6 +50,9 @@ typedef __va_list va_list;
|
||||
#define va_arg(ap, type) \
|
||||
__builtin_va_arg((ap), type)
|
||||
|
||||
#define va_copy(dest, src) \
|
||||
__builtin_va_copy((dest), (src))
|
||||
|
||||
#define va_end(ap) \
|
||||
__builtin_va_end(ap)
|
||||
|
||||
|
@ -50,6 +50,9 @@ typedef __va_list va_list;
|
||||
#define va_arg(ap, type) \
|
||||
__builtin_va_arg((ap), type)
|
||||
|
||||
#define va_copy(dest, src) \
|
||||
__builtin_va_copy((dest), (src))
|
||||
|
||||
#define va_end(ap) \
|
||||
__builtin_va_end(ap)
|
||||
|
||||
|
@ -43,6 +43,9 @@ typedef __va_list va_list;
|
||||
#define va_arg(ap, type) \
|
||||
__builtin_va_arg((ap), type)
|
||||
|
||||
#define va_copy(dest, src) \
|
||||
__builtin_va_copy((dest), (src))
|
||||
|
||||
#define va_end(ap) \
|
||||
__builtin_va_end(ap)
|
||||
|
||||
|
@ -53,6 +53,9 @@ typedef __va_list va_list;
|
||||
#define va_arg(ap, type) \
|
||||
__builtin_va_arg((ap), type)
|
||||
|
||||
#define va_copy(dest, src) \
|
||||
__builtin_va_copy((dest), (src))
|
||||
|
||||
#define va_end(ap) \
|
||||
__builtin_va_end(ap)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user