147791Sbostic /*- 247791Sbostic * Copyright (c) 1991 The Regents of the University of California. 347791Sbostic * All rights reserved. 447791Sbostic * 547791Sbostic * %sccs.include.redist.c% 647791Sbostic * 7*52584Sbostic * @(#)stdarg.h 7.3 (Berkeley) 02/19/92 847791Sbostic */ 947791Sbostic 1047791Sbostic typedef char *va_list; 1147791Sbostic 12*52584Sbostic #define __va_promote(type) \ 13*52584Sbostic (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) 14*52584Sbostic 15*52584Sbostic #define va_start(ap, last) \ 16*52584Sbostic (ap = ((char *)&(last) + __va_promote(last))) 17*52584Sbostic 1849061Sbostic #ifdef KERNEL 1947791Sbostic #define va_arg(ap, type) \ 2049061Sbostic ((type *)(ap += sizeof(type)))[-1] 2149061Sbostic #else 2249061Sbostic #define va_arg(ap, type) \ 2347791Sbostic ((type *)(ap += sizeof(type) < sizeof(int) ? \ 2447791Sbostic (abort(), 0) : sizeof(type)))[-1] 2549061Sbostic #endif 2647791Sbostic 2747791Sbostic #define va_end(ap) 28