Commit | Line | Data |
---|---|---|
887c375f | 1 | /*- |
df7778ec KB |
2 | * Copyright (c) 1991, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
887c375f KB |
4 | * |
5 | * %sccs.include.redist.c% | |
6 | * | |
df7778ec | 7 | * @(#)stdarg.h 8.1 (Berkeley) %G% |
887c375f KB |
8 | */ |
9 | ||
3ffaadf7 KB |
10 | #ifndef _STDARG_H_ |
11 | #define _STDARG_H_ | |
12 | ||
887c375f KB |
13 | typedef char *va_list; |
14 | ||
e1e668dc KB |
15 | #define __va_promote(type) \ |
16 | (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) | |
17 | ||
18 | #define va_start(ap, last) \ | |
19 | (ap = ((char *)&(last) + __va_promote(last))) | |
20 | ||
3b179b9b KB |
21 | #ifdef KERNEL |
22 | #define va_arg(ap, type) \ | |
23 | ((type *)(ap += sizeof(type)))[-1] | |
24 | #else | |
887c375f KB |
25 | #define va_arg(ap, type) \ |
26 | ((type *)(ap += sizeof(type) < sizeof(int) ? \ | |
27 | (abort(), 0) : sizeof(type)))[-1] | |
3b179b9b | 28 | #endif |
887c375f KB |
29 | |
30 | #define va_end(ap) | |
3ffaadf7 KB |
31 | |
32 | #endif /* !_STDARG_H_ */ |