xref: /csrg-svn/sys/hp300/include/stdarg.h (revision 49061)
147791Sbostic /*-
247791Sbostic  * Copyright (c) 1991 The Regents of the University of California.
347791Sbostic  * All rights reserved.
447791Sbostic  *
547791Sbostic  * %sccs.include.redist.c%
647791Sbostic  *
7*49061Sbostic  *	@(#)stdarg.h	7.2 (Berkeley) 05/04/91
847791Sbostic  */
947791Sbostic 
1047791Sbostic typedef char *va_list;
1147791Sbostic 
12*49061Sbostic #ifdef KERNEL
1347791Sbostic #define	va_arg(ap, type) \
14*49061Sbostic 	((type *)(ap += sizeof(type)))[-1]
15*49061Sbostic #else
16*49061Sbostic #define	va_arg(ap, type) \
1747791Sbostic 	((type *)(ap += sizeof(type) < sizeof(int) ? \
1847791Sbostic 		(abort(), 0) : sizeof(type)))[-1]
19*49061Sbostic #endif
2047791Sbostic 
2147791Sbostic #define	va_end(ap)
2247791Sbostic 
2347791Sbostic #define	__va_promote(type) \
2447791Sbostic 	(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
2547791Sbostic 
2647791Sbostic #define	va_start(ap, last) \
2747791Sbostic 	(ap = ((char *)&(last) + __va_promote(last)))
28