OSDN Git Service

* varargs.h, stdarg.h: Include va-mn10200.h.
[pf3gnuchains/gcc-fork.git] / gcc / ginclude / varargs.h
1 /* Record that this is varargs.h; this turns off stdarg.h.  */
2
3 #ifndef _VARARGS_H
4 #define _VARARGS_H
5
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 __M32R__
43 #include "va-m32r.h"
44 #else
45 #ifdef __sh__
46 #include "va-sh.h"
47 #else
48 #ifdef __mn10300__
49 #include "va-mn10300.h"
50 #else
51 #ifdef __mn10200__
52 #include "va-mn10200.h"
53 #else
54
55 #ifdef __NeXT__
56
57 /* On Next, erase any vestiges of stdarg.h.  */
58
59 #ifdef _ANSI_STDARG_H_
60 #define _VA_LIST_
61 #endif
62 #define _ANSI_STDARG_H_ 
63
64 #undef va_alist
65 #undef va_dcl
66 #undef va_list
67 #undef va_start
68 #undef va_end
69 #undef __va_rounded_size
70 #undef va_arg
71 #endif  /* __NeXT__ */
72
73 /* In GCC version 2, we want an ellipsis at the end of the declaration
74    of the argument list.  GCC version 1 can't parse it.  */
75
76 #if __GNUC__ > 1
77 #define __va_ellipsis ...
78 #else
79 #define __va_ellipsis
80 #endif
81
82 /* These macros implement traditional (non-ANSI) varargs
83    for GNU C.  */
84
85 #define va_alist  __builtin_va_alist
86 /* The ... causes current_function_varargs to be set in cc1.  */
87 #define va_dcl    int __builtin_va_alist; __va_ellipsis
88
89 /* Define __gnuc_va_list, just as in gstdarg.h.  */
90
91 #ifndef __GNUC_VA_LIST
92 #define __GNUC_VA_LIST
93 #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
94 typedef char *__gnuc_va_list;
95 #else
96 typedef void *__gnuc_va_list;
97 #endif
98 #endif
99
100 #define va_start(AP)  AP=(char *) &__builtin_va_alist
101
102 #define va_end(AP)      ((void)0)
103
104 #if defined(sysV68)
105 #define __va_rounded_size(TYPE)  \
106   (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short))
107 #else
108 #define __va_rounded_size(TYPE)  \
109   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
110 #endif
111
112 #if defined (__arm__) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
113 /* This is for little-endian machines; small args are padded upward.  */
114 #define va_arg(AP, TYPE)                                                \
115  (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)),     \
116   *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
117 #else /* big-endian */
118 /* This is for big-endian machines; small args are padded downward.  */
119 #define va_arg(AP, TYPE)                                                \
120  (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)),     \
121   *((TYPE *) (void *) ((char *) (AP)                                    \
122                        - ((sizeof (TYPE) < __va_rounded_size (char)     \
123                            ? sizeof (TYPE) : __va_rounded_size (TYPE))))))
124 #endif /* big-endian */
125
126 /* Copy __gnuc_va_list into another variable of this type.  */
127 #define __va_copy(dest, src) (dest) = (src)
128
129 #endif /* not mn10200 */
130 #endif /* not mn10300 */
131 #endif /* not sh */
132 #endif /* not m32r */
133 #endif /* not powerpc with V.4 calling sequence */
134 #endif /* not h8300 */
135 #endif /* not alpha */
136 #endif /* not i960 */
137 #endif /* not hppa */
138 #endif /* not m88k */
139 #endif /* not clipper */
140 #endif /* not pyr */
141 #endif /* not i860 */
142 #endif /* not mips */
143 #endif /* not spur */
144 #endif /* not sparc */
145 #endif /* not _VARARGS_H */
146
147 /* Define va_list from __gnuc_va_list.  */
148
149 #ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
150 #undef _VA_LIST
151 #endif
152
153 #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
154 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
155    so we must avoid testing it and setting it here.
156    SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
157    have no conflict with that.  */
158 #ifndef _VA_LIST_
159 #define _VA_LIST_
160 #ifdef __i860__
161 #ifndef _VA_LIST
162 #define _VA_LIST va_list
163 #endif
164 #endif /* __i860__ */
165 typedef __gnuc_va_list va_list;
166 #ifdef _SCO_DS
167 #define __VA_LIST
168 #endif
169 #endif /* _VA_LIST_ */
170
171 #else /* not __svr4__  || _SCO_DS */
172
173 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
174    But on BSD NET2 we must not test or define or undef it.
175    (Note that the comments in NET 2's ansi.h
176    are incorrect for _VA_LIST_--see stdio.h!)  */
177 /* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993:
178    Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
179    use for va_list (``typedef _VA_LIST_ va_list'') */
180 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
181 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5  */
182 #ifndef _VA_LIST_DEFINED
183 /* The macro _VA_LIST is used in SCO Unix 3.2.  */
184 #ifndef _VA_LIST
185 /* The macro _VA_LIST_T_H is used in the Bull dpx2  */
186 #ifndef _VA_LIST_T_H
187 typedef __gnuc_va_list va_list;
188 #endif /* not _VA_LIST_T_H */
189 #endif /* not _VA_LIST */
190 #endif /* not _VA_LIST_DEFINED */
191 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
192 #define _VA_LIST_
193 #endif
194 #ifndef _VA_LIST
195 #define _VA_LIST
196 #endif
197 #ifndef _VA_LIST_DEFINED
198 #define _VA_LIST_DEFINED
199 #endif
200 #ifndef _VA_LIST_T_H
201 #define _VA_LIST_T_H
202 #endif
203
204 #endif /* not _VA_LIST_, except on certain systems */
205
206 #endif /* not __svr4__ */
207
208 /* The next BSD release (if there is one) wants this symbol to be
209    undefined instead of _VA_LIST_.  */
210 #ifdef _BSD_VA_LIST
211 #undef _BSD_VA_LIST
212 #endif