xref: /original-bsd/sys/hp300/include/stdarg.h (revision a95f03a8)
1 /*-
2  * Copyright (c) 1991 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)stdarg.h	7.3 (Berkeley) 02/19/92
8  */
9 
10 typedef char *va_list;
11 
12 #define	__va_promote(type) \
13 	(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
14 
15 #define	va_start(ap, last) \
16 	(ap = ((char *)&(last) + __va_promote(last)))
17 
18 #ifdef KERNEL
19 #define	va_arg(ap, type) \
20 	((type *)(ap += sizeof(type)))[-1]
21 #else
22 #define	va_arg(ap, type) \
23 	((type *)(ap += sizeof(type) < sizeof(int) ? \
24 		(abort(), 0) : sizeof(type)))[-1]
25 #endif
26 
27 #define	va_end(ap)
28