Install msysDVLPR-1.0.0-alpha-1
[msysgit.git] / lib / gcc-lib / i686-pc-msys / 2.95.3-1 / include / stdarg.h
blob5fbb43247d06c3070b6c37585ed72263f309dd49
1 /* stdarg.h for GNU.
2 Note that the type used in va_arg is supposed to match the
3 actual type **after default promotions**.
4 Thus, va_arg (..., short) is not valid. */
6 #ifndef _STDARG_H
7 #ifndef _ANSI_STDARG_H_
8 #ifndef RC_INVOKED
9 #ifndef __need___va_list
10 #define _STDARG_H
11 #define _ANSI_STDARG_H_
12 #endif /* not __need___va_list */
13 #undef __need___va_list
15 #ifdef __clipper__
16 #include "va-clipper.h"
17 #else
18 #ifdef __m88k__
19 #include "va-m88k.h"
20 #else
21 #ifdef __i860__
22 #include "va-i860.h"
23 #else
24 #ifdef __hppa__
25 #include "va-pa.h"
26 #else
27 #ifdef __mips__
28 #include "va-mips.h"
29 #else
30 #ifdef __sparc__
31 #include "va-sparc.h"
32 #else
33 #ifdef __i960__
34 #include "va-i960.h"
35 #else
36 #ifdef __alpha__
37 #include "va-alpha.h"
38 #else
39 #if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__)
40 #include "va-h8300.h"
41 #else
42 #if defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
43 #include "va-ppc.h"
44 #else
45 #ifdef __arc__
46 #include "va-arc.h"
47 #else
48 #ifdef __M32R__
49 #include "va-m32r.h"
50 #else
51 #ifdef __sh__
52 #include "va-sh.h"
53 #else
54 #ifdef __mn10300__
55 #include "va-mn10300.h"
56 #else
57 #ifdef __mn10200__
58 #include "va-mn10200.h"
59 #else
60 #ifdef __v850__
61 #include "va-v850.h"
62 #else
63 #if defined (_TMS320C4x) || defined (_TMS320C3x)
64 #include <va-c4x.h>
65 #else
67 /* Define __gnuc_va_list. */
69 #ifndef __GNUC_VA_LIST
70 #define __GNUC_VA_LIST
71 #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__) || defined(__MINGW32__)
72 typedef char *__gnuc_va_list;
73 #else
74 typedef void *__gnuc_va_list;
75 #endif
76 #endif
78 /* Define the standard macros for the user,
79 if this invocation was from the user program. */
80 #ifdef _STDARG_H
82 /* Amount of space required in an argument list for an arg of type TYPE.
83 TYPE may alternatively be an expression whose type is used. */
85 #if defined(sysV68)
86 #define __va_rounded_size(TYPE) \
87 (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short))
88 #elif defined(_AIX)
89 #define __va_rounded_size(TYPE) \
90 (((sizeof (TYPE) + sizeof (long) - 1) / sizeof (long)) * sizeof (long))
91 #else
92 #define __va_rounded_size(TYPE) \
93 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
94 #endif
96 #define va_start(AP, LASTARG) \
97 (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
99 #undef va_end
100 void va_end (__gnuc_va_list); /* Defined in libgcc.a */
101 #define va_end(AP) ((void)0)
103 /* We cast to void * and then to TYPE * because this avoids
104 a warning about increasing the alignment requirement. */
106 #if (defined (__arm__) && ! defined (__ARMEB__)) || 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 /* _STDARG_H */
125 #endif /* not TMS320C3x or TMS320C4x */
126 #endif /* not v850 */
127 #endif /* not mn10200 */
128 #endif /* not mn10300 */
129 #endif /* not sh */
130 #endif /* not m32r */
131 #endif /* not arc */
132 #endif /* not powerpc with V.4 calling sequence */
133 #endif /* not h8300 */
134 #endif /* not alpha */
135 #endif /* not i960 */
136 #endif /* not sparc */
137 #endif /* not mips */
138 #endif /* not hppa */
139 #endif /* not i860 */
140 #endif /* not m88k */
141 #endif /* not clipper */
143 #ifdef _STDARG_H
144 /* Define va_list, if desired, from __gnuc_va_list. */
145 /* We deliberately do not define va_list when called from
146 stdio.h, because ANSI C says that stdio.h is not supposed to define
147 va_list. stdio.h needs to have access to that data type,
148 but must not use that name. It should use the name __gnuc_va_list,
149 which is safe because it is reserved for the implementation. */
151 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
152 #undef _VA_LIST
153 #endif
155 #ifdef _BSD_VA_LIST
156 #undef _BSD_VA_LIST
157 #endif
159 #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
160 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
161 so we must avoid testing it and setting it here.
162 SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
163 have no conflict with that. */
164 #ifndef _VA_LIST_
165 #define _VA_LIST_
166 #ifdef __i860__
167 #ifndef _VA_LIST
168 #define _VA_LIST va_list
169 #endif
170 #endif /* __i860__ */
171 typedef __gnuc_va_list va_list;
172 #ifdef _SCO_DS
173 #define __VA_LIST
174 #endif
175 #endif /* _VA_LIST_ */
176 #else /* not __svr4__ || _SCO_DS */
178 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
179 But on BSD NET2 we must not test or define or undef it.
180 (Note that the comments in NET 2's ansi.h
181 are incorrect for _VA_LIST_--see stdio.h!) */
182 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
183 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
184 #ifndef _VA_LIST_DEFINED
185 /* The macro _VA_LIST is used in SCO Unix 3.2. */
186 #ifndef _VA_LIST
187 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
188 #ifndef _VA_LIST_T_H
189 typedef __gnuc_va_list va_list;
190 #endif /* not _VA_LIST_T_H */
191 #endif /* not _VA_LIST */
192 #endif /* not _VA_LIST_DEFINED */
193 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
194 #define _VA_LIST_
195 #endif
196 #ifndef _VA_LIST
197 #define _VA_LIST
198 #endif
199 #ifndef _VA_LIST_DEFINED
200 #define _VA_LIST_DEFINED
201 #endif
202 #ifndef _VA_LIST_T_H
203 #define _VA_LIST_T_H
204 #endif
206 #endif /* not _VA_LIST_, except on certain systems */
208 #endif /* not __svr4__ */
210 #endif /* _STDARG_H */
212 #endif /* not RC_INVOKED */
213 #endif /* not _ANSI_STDARG_H_ */
214 #endif /* not _STDARG_H */