1 /* Define __gnuc_va_list. */ 2 3 #ifndef __GNUC_VA_LIST 4 #define __GNUC_VA_LIST 5 typedef void *__gnuc_va_list; 6 #endif /* not __GNUC_VA_LIST */ 7 8 /* If this is for internal libc use, don't define anything but 9 __gnuc_va_list. */ 10 #if defined (_STDARG_H) || defined (_VARARGS_H) 11 12 #ifdef _STDARG_H 13 #define va_start(AP, LASTARG) \ 14 (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG))) 15 #else 16 #define __va_ellipsis ... 17 #define va_alist __builtin_va_alist 18 #define va_dcl int __builtin_va_alist; __va_ellipsis 19 #define va_start(AP) AP=(char *) &__builtin_va_alist 20 #endif 21 22 /* Now stuff common to both varargs & stdarg implementations. */ 23 #define __va_rounded_size(TYPE) \ 24 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) 25 #undef va_end 26 void va_end (__gnuc_va_list); 27 #define va_end(AP) ((void)0) 28 #define va_arg(AP, TYPE) \ 29 (sizeof (TYPE) > 8 \ 30 ? (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (char *)),\ 31 **((TYPE **) (void *) ((char *) (AP) - __va_rounded_size (char *))))\ 32 : (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ 33 *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))) 34 #endif 35