147791Sbostic /*- 2*63160Sbostic * Copyright (c) 1991, 1993 3*63160Sbostic * The Regents of the University of California. All rights reserved. 447791Sbostic * 547791Sbostic * %sccs.include.redist.c% 647791Sbostic * 7*63160Sbostic * @(#)stdarg.h 8.1 (Berkeley) 06/10/93 847791Sbostic */ 947791Sbostic 1057644Sbostic #ifndef _STDARG_H_ 1157644Sbostic #define _STDARG_H_ 1257644Sbostic 1347791Sbostic typedef char *va_list; 1447791Sbostic 1552584Sbostic #define __va_promote(type) \ 1652584Sbostic (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) 1752584Sbostic 1852584Sbostic #define va_start(ap, last) \ 1952584Sbostic (ap = ((char *)&(last) + __va_promote(last))) 2052584Sbostic 2149061Sbostic #ifdef KERNEL 2247791Sbostic #define va_arg(ap, type) \ 2349061Sbostic ((type *)(ap += sizeof(type)))[-1] 2449061Sbostic #else 2549061Sbostic #define va_arg(ap, type) \ 2647791Sbostic ((type *)(ap += sizeof(type) < sizeof(int) ? \ 2747791Sbostic (abort(), 0) : sizeof(type)))[-1] 2849061Sbostic #endif 2947791Sbostic 3047791Sbostic #define va_end(ap) 3157644Sbostic 3257644Sbostic #endif /* !_STDARG_H_ */ 33