2 Note that the type used in va_arg is supposed to match the
3 actual type **after default promotions**.
4 Thus, va_arg (..., short) is not valid. */
7 #ifndef __need___va_list
10 #undef __need___va_list
13 /* Use the system's macros with the system's compiler. */
38 /* Define __gnuc_va_list. */
40 #ifndef __GNUC_VA_LIST
41 #define __GNUC_VA_LIST
43 typedef char *__gnuc_va_list;
45 typedef void *__gnuc_va_list;
49 /* Define the standard macros for the user,
50 if this invocation was from the user program. */
53 /* Amount of space required in an argument list for an arg of type TYPE.
54 TYPE may alternatively be an expression whose type is used. */
56 #define __va_rounded_size(TYPE) \
57 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
59 #define va_start(AP, LASTARG) \
60 (AP = ((__gnuc_va_list) __builtin_next_arg ()))
62 void va_end (__gnuc_va_list); /* Defined in libgcc.a */
65 /* We cast to void * and then to TYPE * because this avoids
66 a warning about increasing the alignment requirement. */
67 #define va_arg(AP, TYPE) \
68 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
69 *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
70 #endif /* _STDARG_H */
72 #endif /* not alpha */
74 #endif /* not sparc */
81 /* Define va_list, if desired, from __gnuc_va_list. */
82 /* We deliberately do not define va_list when called from
83 stdio.h, because ANSI C says that stdio.h is not supposed to define
84 va_list. stdio.h needs to have access to that data type,
85 but must not use that name. It should use the name __gnuc_va_list,
86 which is safe because it is reserved for the implementation. */
88 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
96 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */
98 /* The macro _VA_LIST is used in SCO Unix 3.2. */
102 typedef __gnuc_va_list va_list;
103 #endif /* _VA_LIST */
104 #endif /* _VA_LIST_ */
105 #endif /* _STDARG_H */
107 #endif /* __GNUC__ */
108 #endif /* not _STDARG_H */