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