1991-12-15 14:56:55 -05:00
|
|
|
/* stdarg.h for GNU.
|
|
|
|
Note that the type used in va_arg is supposed to match the
|
|
|
|
actual type **after default promotions**.
|
|
|
|
Thus, va_arg (..., short) is not valid. */
|
|
|
|
|
|
|
|
#ifndef _STDARG_H
|
1992-06-26 04:44:34 -04:00
|
|
|
#ifndef __need___va_list
|
1991-12-15 14:56:55 -05:00
|
|
|
#define _STDARG_H
|
1992-06-26 04:44:34 -04:00
|
|
|
#endif
|
|
|
|
#undef __need___va_list
|
1991-12-15 14:56:55 -05:00
|
|
|
|
1992-02-06 15:12:32 -05:00
|
|
|
#ifndef __GNUC__
|
|
|
|
/* Use the system's macros with the system's compiler. */
|
|
|
|
#include <stdarg.h>
|
|
|
|
#else
|
1991-12-15 14:56:55 -05:00
|
|
|
#ifdef __m88k__
|
|
|
|
#include "va-m88k.h"
|
|
|
|
#else
|
|
|
|
#ifdef __i860__
|
|
|
|
#include "va-i860.h"
|
|
|
|
#else
|
1992-07-08 10:36:26 -04:00
|
|
|
#ifdef __hppa__
|
1992-07-01 13:37:30 -04:00
|
|
|
#include "va-pa.h"
|
1992-01-30 15:37:09 -05:00
|
|
|
#else
|
|
|
|
#ifdef __mips__
|
|
|
|
#include "va-mips.h"
|
|
|
|
#else
|
1992-03-04 16:58:05 -05:00
|
|
|
#ifdef __sparc__
|
|
|
|
#include "va-sparc.h"
|
|
|
|
#else
|
1992-05-05 13:27:49 -04:00
|
|
|
#ifdef __i960__
|
|
|
|
#include "va-i960.h"
|
|
|
|
#else
|
1992-08-14 15:35:36 -04:00
|
|
|
#ifdef __alpha__
|
|
|
|
#include "va-alpha.h"
|
|
|
|
#else
|
1991-12-15 14:56:55 -05:00
|
|
|
|
1992-06-26 04:44:34 -04:00
|
|
|
/* Define __gnuc_va_list. */
|
1992-02-21 02:00:55 -05:00
|
|
|
|
1992-06-26 04:44:34 -04:00
|
|
|
#ifndef __GNUC_VA_LIST
|
|
|
|
#define __GNUC_VA_LIST
|
|
|
|
#ifdef __svr4__
|
|
|
|
typedef char *__gnuc_va_list;
|
1992-06-01 15:08:29 -04:00
|
|
|
#else
|
1992-06-26 04:44:34 -04:00
|
|
|
typedef void *__gnuc_va_list;
|
1992-06-01 15:08:29 -04:00
|
|
|
#endif
|
1992-06-26 04:44:34 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Define the standard macros for the user,
|
|
|
|
if this invocation was from the user program. */
|
1992-07-02 20:30:05 -04:00
|
|
|
#ifdef _STDARG_H
|
1991-12-15 14:56:55 -05:00
|
|
|
|
|
|
|
/* Amount of space required in an argument list for an arg of type TYPE.
|
|
|
|
TYPE may alternatively be an expression whose type is used. */
|
|
|
|
|
|
|
|
#define __va_rounded_size(TYPE) \
|
|
|
|
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
|
|
|
|
|
|
|
|
#define va_start(AP, LASTARG) \
|
1992-09-28 17:16:00 -04:00
|
|
|
(AP = ((__gnuc_va_list) __builtin_next_arg ()))
|
1991-12-15 14:56:55 -05:00
|
|
|
|
1992-06-26 04:44:34 -04:00
|
|
|
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
|
1991-12-15 14:56:55 -05:00
|
|
|
#define va_end(AP)
|
|
|
|
|
1992-09-15 01:08:02 -04:00
|
|
|
/* We cast to void * and then to TYPE * because this avoids
|
|
|
|
a warning about increasing the alignment requirement. */
|
1991-12-15 14:56:55 -05:00
|
|
|
#define va_arg(AP, TYPE) \
|
1992-09-28 17:16:00 -04:00
|
|
|
(AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
|
1992-09-15 01:08:02 -04:00
|
|
|
*((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
|
1992-06-26 04:44:34 -04:00
|
|
|
#endif /* _STDARG_H */
|
1991-12-15 14:56:55 -05:00
|
|
|
|
1992-08-14 15:35:36 -04:00
|
|
|
#endif /* not alpha */
|
1992-05-05 13:27:49 -04:00
|
|
|
#endif /* not i960 */
|
1992-03-04 16:58:05 -05:00
|
|
|
#endif /* not sparc */
|
1992-01-30 15:37:09 -05:00
|
|
|
#endif /* not mips */
|
1992-07-08 10:36:26 -04:00
|
|
|
#endif /* not hppa */
|
1991-12-15 14:56:55 -05:00
|
|
|
#endif /* not i860 */
|
|
|
|
#endif /* not m88k */
|
1992-06-26 04:44:34 -04:00
|
|
|
|
|
|
|
#ifdef _STDARG_H
|
|
|
|
/* Define va_list, if desired, from __gnuc_va_list. */
|
1992-07-28 16:47:17 -04:00
|
|
|
/* We deliberately do not define va_list when called from
|
|
|
|
stdio.h, because ANSI C says that stdio.h is not supposed to define
|
|
|
|
va_list. stdio.h needs to have access to that data type,
|
|
|
|
but must not use that name. It should use the name __gnuc_va_list,
|
|
|
|
which is safe because it is reserved for the implementation. */
|
1992-06-26 04:44:34 -04:00
|
|
|
|
|
|
|
#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
|
|
|
|
#undef _VA_LIST
|
|
|
|
#endif
|
|
|
|
|
1992-07-07 23:06:31 -04:00
|
|
|
#ifdef _BSD_VA_LIST
|
|
|
|
#undef _BSD_VA_LIST
|
|
|
|
#endif
|
|
|
|
|
1992-06-26 04:44:34 -04:00
|
|
|
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */
|
|
|
|
#ifndef _VA_LIST_
|
|
|
|
/* The macro _VA_LIST is used in SCO Unix 3.2. */
|
|
|
|
#ifndef _VA_LIST
|
|
|
|
#define _VA_LIST_
|
|
|
|
#define _VA_LIST
|
|
|
|
typedef __gnuc_va_list va_list;
|
|
|
|
#endif /* _VA_LIST */
|
|
|
|
#endif /* _VA_LIST_ */
|
1991-12-15 14:56:55 -05:00
|
|
|
#endif /* _STDARG_H */
|
1992-06-26 04:44:34 -04:00
|
|
|
|
|
|
|
#endif /* __GNUC__ */
|
|
|
|
#endif /* not _STDARG_H */
|