Commit | Line | Data |
---|---|---|
c98fe9aa KB |
1 | /*- |
2 | * Copyright (c) 1990 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * %sccs.include.redist.c% | |
6 | * | |
b0a33fea | 7 | * @(#)stdarg.h 5.4 (Berkeley) %G% |
c98fe9aa KB |
8 | */ |
9 | ||
10 | typedef char *va_list; | |
11 | ||
c98fe9aa | 12 | #define va_arg(ap, type) \ |
0f72c2ef | 13 | ((type *)(ap += sizeof(type) < sizeof(int) ? \ |
b197dab6 | 14 | (abort(), 0) : sizeof(type)))[-1] |
0f72c2ef | 15 | |
c98fe9aa | 16 | #define va_end(ap) |
0f72c2ef KB |
17 | |
18 | #define __va_promote(type) \ | |
19 | (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) | |
20 | ||
c98fe9aa | 21 | #define va_start(ap, last) \ |
0f72c2ef | 22 | (ap = ((char *)&(last) + __va_promote(last))) |