|
|
1.1 root 1: /* ---------------------------------------- */
2: /* VARARGS for MIPS/GNU CC */
3: /* */
4: /* */
5: /* */
6: /* */
7: /* ---------------------------------------- */
8:
9:
10: /* These macros implement traditional (non-ANSI) varargs
11: for GNU C. */
12:
13: /* In GCC version 2, we want an ellipsis at the end of the declaration
14: of the argument list. GCC version 1 can't parse it. */
15:
16: #if __GNUC__ > 1
17: #define __va_ellipsis ...
18: #else
19: #define __va_ellipsis
20: #endif
21:
22: #define va_alist __builtin_va_alist
23: #define va_dcl int __builtin_va_alist; __va_ellipsis
24: #ifndef _VA_LIST_
25: #define _VA_LIST_
26: /* Make this a macro rather than a typedef, so we can undef any other defn. */
27: #define va_list __va___list
28: typedef char * __va___list;
29: #endif
30:
31: #define __va_rounded_size(TYPE) \
32: (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
33:
34: #ifdef _STDARG_H
35: #define va_start(AP, LASTARG) \
36: (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
37: #else
38: #define va_start(AP) AP = (char *) &__builtin_va_alist
39: #endif
40:
41: #define va_end(AP)
42:
43: #ifdef lint /* complains about constant in conditional context */
44: #define va_arg(list, mode) ((mode *)(list += sizeof(mode)))[-1]
45:
46: #else /* !lint */
47: #define va_arg(AP, mode) \
48: ((mode *)(AP = (char *) (__alignof(mode) > 4 \
49: ? ((int)AP + 2*8 - 1) & -8 \
50: : ((int)AP + 2*4 - 1) & -4)))[-1]
51: #endif /* lint */
52:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.