xref: /csrg-svn/sys/pmax/include/varargs.h (revision 66436)
156675Sbostic /*-
263217Sbostic  * Copyright (c) 1992, 1993
363217Sbostic  *	The Regents of the University of California.  All rights reserved.
4*66436Sbostic  * (c) UNIX System Laboratories, Inc.
5*66436Sbostic  * All or some portions of this file are derived from material licensed
6*66436Sbostic  * to the University of California by American Telephone and Telegraph
7*66436Sbostic  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8*66436Sbostic  * the permission of UNIX System Laboratories, Inc.
956675Sbostic  *
1056675Sbostic  * %sccs.include.redist.c%
1156675Sbostic  *
12*66436Sbostic  *	@(#)varargs.h	8.2 (Berkeley) 03/22/94
1356675Sbostic  */
1456675Sbostic 
1556675Sbostic #ifndef _VARARGS_H_
1656675Sbostic #define	_VARARGS_H_
1756675Sbostic 
1856675Sbostic typedef char *va_list;
1956675Sbostic 
2056675Sbostic #define	va_dcl	int va_alist;
2156675Sbostic 
2256675Sbostic #define	va_start(ap) \
2356675Sbostic 	ap = (char *)&va_alist
2456675Sbostic 
2556675Sbostic #ifdef KERNEL
2656675Sbostic #define	va_arg(ap, type) \
2756675Sbostic 	((type *)(ap += sizeof(type)))[-1]
2856675Sbostic #else
2956675Sbostic #define	va_arg(ap, type) \
3056675Sbostic 	((type *)(ap += sizeof(type) == sizeof(int) ? sizeof(type) : \
3156675Sbostic 		sizeof(type) > sizeof(int) ? \
3257008Sralph 		(-(int)(ap) & (sizeof(type) - 1)) + sizeof(type) : \
3356675Sbostic 		(abort(), 0)))[-1]
3456675Sbostic #endif
3556675Sbostic 
3656675Sbostic #define	va_end(ap)
3756675Sbostic 
3856675Sbostic #endif /* !_VARARGS_H_ */
39