1 /* Record that this is varargs.h; this turns off stdarg.h. */
22 #include "va-clipper.h"
27 #if defined(__hppa__) || defined(hp800)
36 #if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__)
39 #if defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
52 #include "va-mn10300.h"
55 #include "va-mn10200.h"
63 /* On Next, erase any vestiges of stdarg.h. */
65 #ifdef _ANSI_STDARG_H_
68 #define _ANSI_STDARG_H_
75 #undef __va_rounded_size
79 /* In GCC version 2, we want an ellipsis at the end of the declaration
80 of the argument list. GCC version 1 can't parse it. */
83 #define __va_ellipsis ...
88 /* These macros implement traditional (non-ANSI) varargs
91 #define va_alist __builtin_va_alist
92 /* The ... causes current_function_varargs to be set in cc1. */
93 #define va_dcl int __builtin_va_alist; __va_ellipsis
95 /* Define __gnuc_va_list, just as in gstdarg.h. */
97 #ifndef __GNUC_VA_LIST
98 #define __GNUC_VA_LIST
99 #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
100 typedef char *__gnuc_va_list
;
102 typedef void *__gnuc_va_list
;
106 #define va_start(AP) AP=(char *) &__builtin_va_alist
108 #define va_end(AP) ((void)0)
111 #define __va_rounded_size(TYPE) \
112 (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short))
114 #define __va_rounded_size(TYPE) \
115 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
118 #if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
119 /* This is for little-endian machines; small args are padded upward. */
120 #define va_arg(AP, TYPE) \
121 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
122 *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
123 #else /* big-endian */
124 /* This is for big-endian machines; small args are padded downward. */
125 #define va_arg(AP, TYPE) \
126 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
127 *((TYPE *) (void *) ((char *) (AP) \
128 - ((sizeof (TYPE) < __va_rounded_size (char) \
129 ? sizeof (TYPE) : __va_rounded_size (TYPE))))))
130 #endif /* big-endian */
132 /* Copy __gnuc_va_list into another variable of this type. */
133 #define __va_copy(dest, src) (dest) = (src)
135 #endif /* not v850 */
136 #endif /* not mn10200 */
137 #endif /* not mn10300 */
139 #endif /* not m32r */
141 #endif /* not powerpc with V.4 calling sequence */
142 #endif /* not h8300 */
143 #endif /* not alpha */
144 #endif /* not i960 */
145 #endif /* not hppa */
146 #endif /* not m88k */
147 #endif /* not clipper */
149 #endif /* not i860 */
150 #endif /* not mips */
151 #endif /* not spur */
152 #endif /* not sparc */
153 #endif /* not _VARARGS_H */
155 /* Define va_list from __gnuc_va_list. */
157 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
161 #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
162 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
163 so we must avoid testing it and setting it here.
164 SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
165 have no conflict with that. */
170 #define _VA_LIST va_list
172 #endif /* __i860__ */
173 typedef __gnuc_va_list
va_list;
177 #endif /* _VA_LIST_ */
179 #else /* not __svr4__ || _SCO_DS */
181 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
182 But on BSD NET2 we must not test or define or undef it.
183 (Note that the comments in NET 2's ansi.h
184 are incorrect for _VA_LIST_--see stdio.h!) */
185 /* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993:
186 Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
187 use for va_list (``typedef _VA_LIST_ va_list'') */
188 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
189 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
190 #ifndef _VA_LIST_DEFINED
191 /* The macro _VA_LIST is used in SCO Unix 3.2. */
193 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
195 typedef __gnuc_va_list
va_list;
196 #endif /* not _VA_LIST_T_H */
197 #endif /* not _VA_LIST */
198 #endif /* not _VA_LIST_DEFINED */
199 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
205 #ifndef _VA_LIST_DEFINED
206 #define _VA_LIST_DEFINED
212 #endif /* not _VA_LIST_, except on certain systems */
214 #endif /* not __svr4__ */
216 /* The next BSD release (if there is one) wants this symbol to be
217 undefined instead of _VA_LIST_. */