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