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))
46 #include "va-mn10300.h"
51 /* On Next, erase any vestiges of stdarg.h. */
53 #ifdef _ANSI_STDARG_H_
56 #define _ANSI_STDARG_H_
63 #undef __va_rounded_size
67 /* In GCC version 2, we want an ellipsis at the end of the declaration
68 of the argument list. GCC version 1 can't parse it. */
71 #define __va_ellipsis ...
76 /* These macros implement traditional (non-ANSI) varargs
79 #define va_alist __builtin_va_alist
80 /* The ... causes current_function_varargs to be set in cc1. */
81 #define va_dcl int __builtin_va_alist; __va_ellipsis
83 /* Define __gnuc_va_list, just as in gstdarg.h. */
85 #ifndef __GNUC_VA_LIST
86 #define __GNUC_VA_LIST
87 #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
88 typedef char *__gnuc_va_list;
90 typedef void *__gnuc_va_list;
94 #define va_start(AP) AP=(char *) &__builtin_va_alist
96 #define va_end(AP) ((void)0)
99 #define __va_rounded_size(TYPE) \
100 (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short))
102 #define __va_rounded_size(TYPE) \
103 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
106 #if defined (__arm__) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
107 /* This is for little-endian machines; small args are padded upward. */
108 #define va_arg(AP, TYPE) \
109 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
110 *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
111 #else /* big-endian */
112 /* This is for big-endian machines; small args are padded downward. */
113 #define va_arg(AP, TYPE) \
114 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
115 *((TYPE *) (void *) ((char *) (AP) \
116 - ((sizeof (TYPE) < __va_rounded_size (char) \
117 ? sizeof (TYPE) : __va_rounded_size (TYPE))))))
118 #endif /* big-endian */
120 /* Copy __gnuc_va_list into another variable of this type. */
121 #define __va_copy(dest, src) (dest) = (src)
123 #endif /* not mn10300 */
125 #endif /* not powerpc with V.4 calling sequence */
126 #endif /* not h8300 */
127 #endif /* not alpha */
128 #endif /* not i960 */
129 #endif /* not hppa */
130 #endif /* not m88k */
131 #endif /* not clipper */
133 #endif /* not i860 */
134 #endif /* not mips */
135 #endif /* not spur */
136 #endif /* not sparc */
137 #endif /* not _VARARGS_H */
139 /* Define va_list from __gnuc_va_list. */
141 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
145 #if defined(__svr4__) || defined(_SCO_DS)
146 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
147 so we must avoid testing it and setting it here.
148 SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
149 have no conflict with that. */
154 #define _VA_LIST va_list
156 #endif /* __i860__ */
157 typedef __gnuc_va_list va_list;
158 #endif /* _VA_LIST_ */
160 #else /* not __svr4__ || _SCO_DS */
162 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
163 But on BSD NET2 we must not test or define or undef it.
164 (Note that the comments in NET 2's ansi.h
165 are incorrect for _VA_LIST_--see stdio.h!) */
166 /* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993:
167 Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
168 use for va_list (``typedef _VA_LIST_ va_list'') */
169 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
170 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
171 #ifndef _VA_LIST_DEFINED
172 /* The macro _VA_LIST is used in SCO Unix 3.2. */
174 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
176 typedef __gnuc_va_list va_list;
177 #endif /* not _VA_LIST_T_H */
178 #endif /* not _VA_LIST */
179 #endif /* not _VA_LIST_DEFINED */
180 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
186 #ifndef _VA_LIST_DEFINED
187 #define _VA_LIST_DEFINED
193 #endif /* not _VA_LIST_, except on certain systems */
195 #endif /* not __svr4__ */
197 /* The next BSD release (if there is one) wants this symbol to be
198 undefined instead of _VA_LIST_. */