xref: /csrg-svn/include/stdarg.h (revision 46552)
141889Sbostic /*-
241889Sbostic  * Copyright (c) 1990 The Regents of the University of California.
341889Sbostic  * All rights reserved.
441889Sbostic  *
541889Sbostic  * %sccs.include.redist.c%
641889Sbostic  *
7*46552Sbostic  *	@(#)stdarg.h	5.5 (Berkeley) 02/22/91
841889Sbostic  */
941889Sbostic 
10*46552Sbostic #ifndef _STDARG_H
11*46552Sbostic #define	_STDARG_H
12*46552Sbostic 
1341889Sbostic typedef char *va_list;
1441889Sbostic 
1542236Sbostic #define	va_arg(ap, type) \
1642236Sbostic 	((type *)(ap += sizeof(type) < sizeof(int) ? \
1743677Sbostic 		(abort(), 0) : sizeof(type)))[-1]
1842236Sbostic 
1942236Sbostic #define	va_end(ap)
2042236Sbostic 
2142236Sbostic #define	__va_promote(type) \
2241889Sbostic 	(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
2341889Sbostic 
2441889Sbostic #define	va_start(ap, last) \
2542236Sbostic 	(ap = ((char *)&(last) + __va_promote(last)))
26*46552Sbostic 
27*46552Sbostic #endif /* !_STDARG_H */
28