|
|
1.1 root 1: /* GNU C varargs support for the Intel 80960. */
2:
3: /* In GCC version 2, we want an ellipsis at the end of the declaration
4: of the argument list. GCC version 1 can't parse it. */
5:
6: #if __GNUC__ > 1
7: #define __va_ellipsis ...
8: #else
9: #define __va_ellipsis
10: #endif
11:
12: /* The first element is the address of the first argument.
13: The second element is the number of bytes skipped past so far. */
14: typedef unsigned va_list[2];
15:
16: /* The stack size of the type t. */
17: #define __vsiz(T) (((sizeof (T) + 3) / 4) * 4)
18: /* The stack alignment of the type t. */
19: #define __vali(T) (__alignof__ (T) >= 4 ? __alignof__ (T) : 4)
20: /* The offset of the next stack argument after one of type t at offset i. */
21: #define __vpad(I, T) ((((I) + __vali (T) - 1) / __vali (T)) \
22: * __vali (T) + __vsiz (T))
23:
24: #ifdef _STDARG_H
25: #define va_start(AP, LASTARG) ((AP)[1] = 0, \
26: *(AP) = (unsigned) __builtin_next_arg ())
27: #else
28:
29: #define va_alist __builtin_va_alist
30: #define va_dcl char *__builtin_va_alist; __va_ellipsis
31: #define va_start(AP) ((AP)[1] = 0, *(AP) = (unsigned) &va_alist)
32: #endif
33:
34: #define va_arg(AP, T) \
35: ( \
36: ( \
37: ((AP)[1] <= 48 && (__vpad ((AP)[1], T) > 48 || __vsiz (T) > 16)) \
38: ? ((AP)[1] = 48 + __vsiz (T)) \
39: : ((AP)[1] = __vpad ((AP)[1], T)) \
40: ), \
41: \
42: *((T *) ((char *) *(AP) + (AP)[1] - __vsiz (T))) \
43: )
44:
45: #define va_end(AP)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.