Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / contrib / gcc / ginclude / varargs.h
1 /* Record that this is varargs.h; this turns off stdarg.h.  */
2
3 /* $FreeBSD: src/contrib/gcc/ginclude/varargs.h,v 1.4 1999/10/16 07:12:34 obrien Exp $ */
4 /* $DragonFly: src/contrib/gcc/ginclude/Attic/varargs.h,v 1.2 2003/06/17 04:24:02 dillon Exp $ */
5
6 #ifndef _VARARGS_H
7 #define _VARARGS_H
8
9 #ifdef __sparc__
10 #include "va-sparc.h"
11 #else
12 #ifdef __spur__
13 #include "va-spur.h"
14 #else
15 #ifdef __mips__
16 #include "va-mips.h"
17 #else
18 #ifdef __i860__
19 #include "va-i860.h"
20 #else
21 #ifdef __pyr__
22 #include "va-pyr.h"
23 #else
24 #ifdef __clipper__
25 #include "va-clipper.h"
26 #else
27 #ifdef __m88k__
28 #include "va-m88k.h"
29 #else
30 #if defined(__hppa__) || defined(hp800)
31 #include "va-pa.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
66
67 #ifdef __NeXT__
68
69 /* On Next, erase any vestiges of stdarg.h.  */
70
71 #ifdef _ANSI_STDARG_H_
72 #define _VA_LIST_
73 #endif
74 #define _ANSI_STDARG_H_ 
75
76 #undef va_alist
77 #undef va_dcl
78 #undef va_list
79 #undef va_start
80 #undef va_end
81 #undef __va_rounded_size
82 #undef va_arg
83 #endif  /* __NeXT__ */
84
85 /* In GCC version 2, we want an ellipsis at the end of the declaration
86    of the argument list.  GCC version 1 can't parse it.  */
87
88 #if __GNUC__ > 1
89 #define __va_ellipsis ...
90 #else
91 #define __va_ellipsis
92 #endif
93
94 /* These macros implement traditional (non-ANSI) varargs
95    for GNU C.  */
96
97 #define va_alist  __builtin_va_alist
98 /* The ... causes current_function_varargs to be set in cc1.  */
99 /* ??? We don't process attributes correctly in K&R argument context.  */
100 typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
101 #define va_dcl  __builtin_va_alist_t __builtin_va_alist; __va_ellipsis
102
103 /* Define __gnuc_va_list, just as in gstdarg.h.  */
104
105 #ifndef __GNUC_VA_LIST
106 #define __GNUC_VA_LIST
107 #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
108 typedef char *__gnuc_va_list;
109 #else
110 typedef void *__gnuc_va_list;
111 #endif
112 #endif
113
114 #define va_start(AP)  AP=(char *) &__builtin_va_alist
115
116 #define va_end(AP)      ((void)0)
117
118 #if defined(sysV68)
119 #define __va_rounded_size(TYPE)  \
120   (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short))
121 #elif defined(_AIX)
122 #define __va_rounded_size(TYPE)  \
123   (((sizeof (TYPE) + sizeof (long) - 1) / sizeof (long)) * sizeof (long))
124 #else
125 #define __va_rounded_size(TYPE)  \
126   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
127 #endif
128
129 #if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
130 /* This is for little-endian machines; small args are padded upward.  */
131 #define va_arg(AP, TYPE)                                                \
132  (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)),     \
133   *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
134 #else /* big-endian */
135 /* This is for big-endian machines; small args are padded downward.  */
136 #define va_arg(AP, TYPE)                                                \
137  (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)),     \
138   *((TYPE *) (void *) ((char *) (AP)                                    \
139                        - ((sizeof (TYPE) < __va_rounded_size (char)     \
140                            ? sizeof (TYPE) : __va_rounded_size (TYPE))))))
141 #endif /* big-endian */
142
143 /* Copy __gnuc_va_list into another variable of this type.  */
144 #define __va_copy(dest, src) (dest) = (src)
145
146 #endif /* not TMS320C3x or TMS320C4x */
147 #endif /* not v850 */
148 #endif /* not mn10200 */
149 #endif /* not mn10300 */
150 #endif /* not sh */
151 #endif /* not m32r */
152 #endif /* not arc */
153 #endif /* not powerpc with V.4 calling sequence */
154 #endif /* not h8300 */
155 #endif /* not alpha */
156 #endif /* not i960 */
157 #endif /* not hppa */
158 #endif /* not m88k */
159 #endif /* not clipper */
160 #endif /* not pyr */
161 #endif /* not i860 */
162 #endif /* not mips */
163 #endif /* not spur */
164 #endif /* not sparc */
165 #endif /* not _VARARGS_H */
166
167 /* Define va_list from __gnuc_va_list.  */
168
169 #ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
170 #undef _VA_LIST
171 #endif
172
173 #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
174 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
175    so we must avoid testing it and setting it here.
176    SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
177    have no conflict with that.  */
178 #ifndef _VA_LIST_
179 #define _VA_LIST_
180 #ifdef __i860__
181 #ifndef _VA_LIST
182 #define _VA_LIST va_list
183 #endif
184 #endif /* __i860__ */
185 typedef __gnuc_va_list va_list;
186 #ifdef _SCO_DS
187 #define __VA_LIST
188 #endif
189 #endif /* _VA_LIST_ */
190
191 #else /* not __svr4__  || _SCO_DS */
192
193 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
194    But on BSD NET2 we must not test or define or undef it.
195    (Note that the comments in NET 2's ansi.h
196    are incorrect for _VA_LIST_--see stdio.h!)  */
197 /* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993:
198    Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
199    use for va_list (``typedef _VA_LIST_ va_list'') */
200 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
201 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5  */
202 #ifndef _VA_LIST_DEFINED
203 /* The macro _VA_LIST is used in SCO Unix 3.2.  */
204 #ifndef _VA_LIST
205 /* The macro _VA_LIST_T_H is used in the Bull dpx2  */
206 #ifndef _VA_LIST_T_H
207 typedef __gnuc_va_list va_list;
208 #endif /* not _VA_LIST_T_H */
209 #endif /* not _VA_LIST */
210 #endif /* not _VA_LIST_DEFINED */
211 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
212 #define _VA_LIST_
213 #endif
214 #ifndef _VA_LIST
215 #define _VA_LIST
216 #endif
217 #ifndef _VA_LIST_DEFINED
218 #define _VA_LIST_DEFINED
219 #endif
220 #ifndef _VA_LIST_T_H
221 #define _VA_LIST_T_H
222 #endif
223
224 #endif /* not _VA_LIST_, except on certain systems */
225
226 #endif /* not __svr4__ */
227
228 /* The next BSD release (if there is one) wants this symbol to be
229    undefined instead of _VA_LIST_.  */
230 #ifdef _BSD_VA_LIST
231 #undef _BSD_VA_LIST
232 #endif