1 /* ---------------------------------------- */
2 /* VARARGS for MIPS/GNU CC */
7 /* ---------------------------------------- */
10 /* These macros implement traditional (non-ANSI) varargs
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. */
17 #define __va_ellipsis ...
22 #define va_alist __builtin_va_alist
23 #define va_dcl int __builtin_va_alist; __va_ellipsis
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;
31 #define __va_rounded_size(TYPE) \
32 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
35 #define va_start(AP, LASTARG) \
36 (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
38 #define va_start(AP) AP = (char *) &__builtin_va_alist
43 #ifdef lint /* complains about constant in conditional context */
44 #define va_arg(list, mode) ((mode *)(list += sizeof(mode)))[-1]
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]