156674Sbostic /*- 256674Sbostic * Copyright (c) 1992 The Regents of the University of California. 356674Sbostic * All rights reserved. 456674Sbostic * 556674Sbostic * %sccs.include.redist.c% 656674Sbostic * 7*57645Sbostic * @(#)stdarg.h 7.3 (Berkeley) 01/21/93 856674Sbostic */ 956674Sbostic 10*57645Sbostic #ifndef _STDARG_H_ 11*57645Sbostic #define _STDARG_H_ 12*57645Sbostic 1356674Sbostic typedef char *va_list; 1456674Sbostic 1556674Sbostic #define __va_promote(type) \ 1656674Sbostic (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) 1756674Sbostic 1856674Sbostic #define va_start(ap, last) \ 1956674Sbostic (ap = ((char *)&(last) + __va_promote(last))) 2056674Sbostic 2156674Sbostic #ifdef KERNEL 2256674Sbostic #define va_arg(ap, type) \ 2356674Sbostic ((type *)(ap += sizeof(type)))[-1] 2456674Sbostic #else 2556674Sbostic #define va_arg(ap, type) \ 2656674Sbostic ((type *)(ap += sizeof(type) == sizeof(int) ? sizeof(type) : \ 2756674Sbostic sizeof(type) > sizeof(int) ? \ 2857008Sralph (-(int)(ap) & (sizeof(type) - 1)) + sizeof(type) : \ 2956674Sbostic (abort(), 0)))[-1] 3056674Sbostic #endif 3156674Sbostic 3256674Sbostic #define va_end(ap) 33*57645Sbostic 34*57645Sbostic #endif /* !_STDARG_H_ */ 35