xref: /csrg-svn/sys/sparc/include/stdarg.h (revision 55126)
1*55126Storek /*
2*55126Storek  * Copyright (c) 1992 The Regents of the University of California.
3*55126Storek  * All rights reserved.
4*55126Storek  *
5*55126Storek  * This software was developed by the Computer Systems Engineering group
6*55126Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7*55126Storek  * contributed to Berkeley.
8*55126Storek  *
9*55126Storek  * %sccs.include.redist.c%
10*55126Storek  *
11*55126Storek  *	@(#)stdarg.h	7.1 (Berkeley) 07/13/92
12*55126Storek  *
13*55126Storek  * from: $Header: stdarg.h,v 1.5 92/06/17 06:10:29 torek Exp $
14*55126Storek  */
15*55126Storek 
16*55126Storek /*
17*55126Storek  * SPARC stdarg.h
18*55126Storek  */
19*55126Storek 
20*55126Storek #ifndef _MACHINE_STDARG_H
21*55126Storek #define _MACHINE_STDARG_H
22*55126Storek 
23*55126Storek typedef char *va_list;
24*55126Storek 
25*55126Storek /*
26*55126Storek  * va_start sets ap to point to the first variable argument.
27*55126Storek  * The `last fixed argument' parameter l is ignored (and should
28*55126Storek  * never have been included in the ANSI standard!).
29*55126Storek  *
30*55126Storek  * va_end cleans up after va_start.  There is nothing to do there.
31*55126Storek  */
32*55126Storek #define va_start(ap, l)	(__builtin_saveregs(), \
33*55126Storek 			 ap = (char *)__builtin_next_arg())
34*55126Storek #define va_end(ap)	/* empty */
35*55126Storek 
36*55126Storek /*
37*55126Storek  * va_arg picks up the next argument of type `t'.  Appending an
38*55126Storek  * asterisk to t must produce a pointer to t (i.e., t may not be,
39*55126Storek  * e.g., `int (*)()').  In addition, t must not be any type which
40*55126Storek  * undergoes promotion to some other type (e.g., char): it must
41*55126Storek  * be the promoted type instead.
42*55126Storek  */
43*55126Storek #define va_arg(ap, t)	(((t *)(ap += sizeof(t)))[-1])
44*55126Storek 
45*55126Storek #endif /* _MACHINE_STDARG_H */
46