2 /* Use the system's macros with the system's compiler. */
5 /* Record that this is varargs.h; this turns off stdarg.h. */
26 #include <va-clipper.h>
31 #if defined(__hppa__) || defined(hp800)
43 /* On Next, erase any vestiges of stdarg.h. */
45 #ifdef _ANSI_STDARG_H_
48 #define _ANSI_STDARG_H_
55 #undef __va_rounded_size
59 /* In GCC version 2, we want an ellipsis at the end of the declaration
60 of the argument list. GCC version 1 can't parse it. */
63 #define __va_ellipsis ...
68 /* These macros implement traditional (non-ANSI) varargs
71 #define va_alist __builtin_va_alist
72 /* The ... causes current_function_varargs to be set in cc1. */
73 #define va_dcl int __builtin_va_alist; __va_ellipsis
75 /* Define __gnuc_va_list, just as in gstdarg.h. */
77 #ifndef __GNUC_VA_LIST
78 #define __GNUC_VA_LIST
79 #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
80 typedef char *__gnuc_va_list;
82 typedef void *__gnuc_va_list;
86 #define va_start(AP) AP=(char *) &__builtin_va_alist
90 #define __va_rounded_size(TYPE) \
91 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
93 #if defined (__arm__) || defined (__i386__) || defined (__ns32000__) || defined (__vax__)
94 /* This is for little-endian machines; small args are padded upward. */
95 #define va_arg(AP, TYPE) \
96 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
97 *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
98 #else /* big-endian */
99 /* This is for big-endian machines; small args are padded downward. */
100 #define va_arg(AP, TYPE) \
101 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
102 *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \
104 : __va_rounded_size (TYPE))))))
105 #endif /* big-endian */
107 #endif /* not alpha */
108 #endif /* not i960 */
109 #endif /* not hppa */
110 #endif /* not m88k */
111 #endif /* not clipper */
113 #endif /* not i860 */
114 #endif /* not mips */
115 #endif /* not spur */
116 #endif /* not sparc */
117 #endif /* not _VARARGS_H */
119 /* Define va_list from __gnuc_va_list. */
121 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
127 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
128 so we must avoid testing it and setting it here. */
131 typedef __gnuc_va_list va_list;
132 #endif /* _VA_LIST_ */
134 #else /* not __SVR4_2__ */
136 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
137 But on BSD NET2 we must not test or define or undef it.
138 (Note that the comments in NET 2's ansi.h
139 are incorrect for _VA_LIST_--see stdio.h!) */
140 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____)
141 /* The macro _VA_LIST is used in SCO Unix 3.2. */
143 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
146 #if !(defined (__BSD_NET2__) || defined (____386BSD____))
150 typedef __gnuc_va_list va_list;
151 #endif /* not _VA_LIST_T_H */
152 #endif /* not _VA_LIST */
153 #endif /* not _VA_LIST_ */
155 #endif /* not __SVR4_2__ */
157 /* The next BSD release (if there is one) wants this symbol to be
158 undefined instead of _VA_LIST_. */
163 #endif /* __GNUC__ */