OSDN Git Service

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