1992-06-26 04:38:37 -04:00
|
|
|
|
1992-08-06 13:09:02 -04:00
|
|
|
/* Define __gnuc_va_list. */
|
1992-06-26 04:38:37 -04:00
|
|
|
|
|
|
|
#ifndef __GNUC_VA_LIST
|
|
|
|
#define __GNUC_VA_LIST
|
|
|
|
|
1996-01-17 05:26:27 -05:00
|
|
|
typedef void *__gnuc_va_list;
|
1992-06-26 04:38:37 -04:00
|
|
|
#endif /* not __GNUC_VA_LIST */
|
|
|
|
|
|
|
|
/* If this is for internal libc use, don't define anything but
|
|
|
|
__gnuc_va_list. */
|
|
|
|
#if defined (_STDARG_H) || defined (_VARARGS_H)
|
1992-10-14 10:50:17 -04:00
|
|
|
#if __GNUC__ > 1
|
|
|
|
#define __va_ellipsis ...
|
|
|
|
#define __gnuc_va_start(AP) ((AP) = (va_list)__builtin_saveregs())
|
|
|
|
#else
|
|
|
|
#define va_alist __va_a__, __va_b__, __va_c__, __va_d__
|
|
|
|
#define __va_ellipsis
|
|
|
|
#define __gnuc_va_start(AP)\
|
|
|
|
(AP) = (double *) &__va_a__, &__va_b__, &__va_c__, &__va_d__, \
|
|
|
|
(AP) = (double *)((char *)(AP) + 4)
|
|
|
|
#endif /* __GNUC__ > 1 */
|
|
|
|
|
1994-03-23 17:20:35 -05:00
|
|
|
/* Call __builtin_next_arg even though we aren't using its value, so that
|
|
|
|
we can verify that LASTARG is correct. */
|
1992-06-26 04:38:37 -04:00
|
|
|
#ifdef _STDARG_H
|
1994-03-23 17:20:35 -05:00
|
|
|
#define va_start(AP,LASTARG) \
|
|
|
|
(__builtin_next_arg (LASTARG), __gnuc_va_start (AP))
|
1992-06-26 04:38:37 -04:00
|
|
|
#else
|
|
|
|
/* The ... causes current_function_varargs to be set in cc1. */
|
1992-10-14 10:50:17 -04:00
|
|
|
#define va_dcl long va_alist; __va_ellipsis
|
|
|
|
#define va_start(AP) __gnuc_va_start (AP)
|
1992-08-06 13:09:02 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define va_arg(AP,TYPE) \
|
1995-04-14 19:44:01 -04:00
|
|
|
(*(sizeof(TYPE) > 8 ? \
|
1992-08-06 13:09:02 -04:00
|
|
|
((AP = (__gnuc_va_list) ((char *)AP - sizeof (int))), \
|
1995-04-14 19:44:01 -04:00
|
|
|
(((TYPE *) (void *) (*((int *) (AP)))))) \
|
1992-08-06 13:09:02 -04:00
|
|
|
:((AP = \
|
|
|
|
(__gnuc_va_list) ((long)((char *)AP - sizeof (TYPE)) \
|
|
|
|
& (sizeof(TYPE) > 4 ? ~0x7 : ~0x3))), \
|
1995-04-14 19:44:01 -04:00
|
|
|
(((TYPE *) (void *) ((char *)AP + ((8 - sizeof(TYPE)) % 4)))))))
|
1992-06-26 04:38:37 -04:00
|
|
|
|
1992-11-04 10:09:20 -05:00
|
|
|
#ifndef va_end
|
|
|
|
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
|
|
|
|
#endif
|
1995-02-24 21:35:35 -05:00
|
|
|
#define va_end(AP) ((void)0)
|
1992-06-26 04:38:37 -04:00
|
|
|
|
1997-03-02 17:41:16 -05:00
|
|
|
/* Copy __gnuc_va_list into another variable of this type. */
|
|
|
|
#define __va_copy(dest, src) (dest) = (src)
|
|
|
|
|
1992-06-26 04:38:37 -04:00
|
|
|
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
|