* ginclude/stdarg.h: Include va-mn10300.h.
[official-gcc.git] / gcc / ginclude / varargs.h
blobc8fa2059debcad315252fb64dcff01dc290f0c34
1 /* Record that this is varargs.h; this turns off stdarg.h. */
3 #ifndef _VARARGS_H
4 #define _VARARGS_H
6 #ifdef __sparc__
7 #include "va-sparc.h"
8 #else
9 #ifdef __spur__
10 #include "va-spur.h"
11 #else
12 #ifdef __mips__
13 #include "va-mips.h"
14 #else
15 #ifdef __i860__
16 #include "va-i860.h"
17 #else
18 #ifdef __pyr__
19 #include "va-pyr.h"
20 #else
21 #ifdef __clipper__
22 #include "va-clipper.h"
23 #else
24 #ifdef __m88k__
25 #include "va-m88k.h"
26 #else
27 #if defined(__hppa__) || defined(hp800)
28 #include "va-pa.h"
29 #else
30 #ifdef __i960__
31 #include "va-i960.h"
32 #else
33 #ifdef __alpha__
34 #include "va-alpha.h"
35 #else
36 #if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__)
37 #include "va-h8300.h"
38 #else
39 #if defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
40 #include "va-ppc.h"
41 #else
42 #ifdef __sh__
43 #include "va-sh.h"
44 #else
45 #ifdef __mn10300__
46 #include "va-mn10300.h"
47 #else
49 #ifdef __NeXT__
51 /* On Next, erase any vestiges of stdarg.h. */
53 #ifdef _ANSI_STDARG_H_
54 #define _VA_LIST_
55 #endif
56 #define _ANSI_STDARG_H_
58 #undef va_alist
59 #undef va_dcl
60 #undef va_list
61 #undef va_start
62 #undef va_end
63 #undef __va_rounded_size
64 #undef va_arg
65 #endif /* __NeXT__ */
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. */
70 #if __GNUC__ > 1
71 #define __va_ellipsis ...
72 #else
73 #define __va_ellipsis
74 #endif
76 /* These macros implement traditional (non-ANSI) varargs
77 for GNU C. */
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;
89 #else
90 typedef void *__gnuc_va_list;
91 #endif
92 #endif
94 #define va_start(AP) AP=(char *) &__builtin_va_alist
96 #define va_end(AP) ((void)0)
98 #if defined(sysV68)
99 #define __va_rounded_size(TYPE) \
100 (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short))
101 #else
102 #define __va_rounded_size(TYPE) \
103 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
104 #endif
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 */
124 #endif /* not sh */
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 */
132 #endif /* not pyr */
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". */
142 #undef _VA_LIST
143 #endif
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. */
150 #ifndef _VA_LIST_
151 #define _VA_LIST_
152 #ifdef __i860__
153 #ifndef _VA_LIST
154 #define _VA_LIST va_list
155 #endif
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. */
173 #ifndef _VA_LIST
174 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
175 #ifndef _VA_LIST_T_H
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__))
181 #define _VA_LIST_
182 #endif
183 #ifndef _VA_LIST
184 #define _VA_LIST
185 #endif
186 #ifndef _VA_LIST_DEFINED
187 #define _VA_LIST_DEFINED
188 #endif
189 #ifndef _VA_LIST_T_H
190 #define _VA_LIST_T_H
191 #endif
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_. */
199 #ifdef _BSD_VA_LIST
200 #undef _BSD_VA_LIST
201 #endif