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.
14 This is relevant only when building GCC with some other compiler. */
39 /* Define __gnuc_va_list. */
41 #ifndef __GNUC_VA_LIST
42 #define __GNUC_VA_LIST
44 typedef char *__gnuc_va_list;
46 typedef void *__gnuc_va_list;
50 /* Define the standard macros for the user,
51 if this invocation was from the user program. */
54 /* Amount of space required in an argument list for an arg of type TYPE.
55 TYPE may alternatively be an expression whose type is used. */
57 #define __va_rounded_size(TYPE) \
58 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
60 #define va_start(AP, LASTARG) \
61 (AP = ((__gnuc_va_list) __builtin_next_arg ()))
63 void va_end (__gnuc_va_list); /* Defined in libgcc.a */
66 /* We cast to void * and then to TYPE * because this avoids
67 a warning about increasing the alignment requirement. */
68 #define va_arg(AP, TYPE) \
69 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
70 *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
71 #endif /* _STDARG_H */
73 #endif /* not alpha */
75 #endif /* not sparc */
82 /* Define va_list, if desired, from __gnuc_va_list. */
83 /* We deliberately do not define va_list when called from
84 stdio.h, because ANSI C says that stdio.h is not supposed to define
85 va_list. stdio.h needs to have access to that data type,
86 but must not use that name. It should use the name __gnuc_va_list,
87 which is safe because it is reserved for the implementation. */
89 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
97 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */
99 /* The macro _VA_LIST is used in SCO Unix 3.2. */
103 typedef __gnuc_va_list va_list;
104 #endif /* _VA_LIST */
105 #endif /* _VA_LIST_ */
106 #endif /* _STDARG_H */
108 #endif /* __GNUC__ */
109 #endif /* not _STDARG_H */