]>
gcc.gnu.org Git - gcc.git/blob - gcc/ginclude/varargs.h
1 /* Record that this is varargs.h; this turns off stdarg.h. */
22 #include <va-clipper.h>
27 #if defined(__hppa__) || defined(hp800)
36 #if defined (__H8300__) || defined (__H8300H__)
42 /* On Next, erase any vestiges of stdarg.h. */
44 #ifdef _ANSI_STDARG_H_
47 #define _ANSI_STDARG_H_
54 #undef __va_rounded_size
58 /* In GCC version 2, we want an ellipsis at the end of the declaration
59 of the argument list. GCC version 1 can't parse it. */
62 #define __va_ellipsis ...
67 /* These macros implement traditional (non-ANSI) varargs
70 #define va_alist __builtin_va_alist
71 /* The ... causes current_function_varargs to be set in cc1. */
72 #define va_dcl int __builtin_va_alist; __va_ellipsis
74 /* Define __gnuc_va_list, just as in gstdarg.h. */
76 #ifndef __GNUC_VA_LIST
77 #define __GNUC_VA_LIST
78 #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
79 typedef char * __gnuc_va_list
;
81 typedef void * __gnuc_va_list
;
85 #define va_start(AP) AP=(char *) &__builtin_va_alist
90 #define __va_rounded_size(TYPE) \
91 (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short))
93 #define __va_rounded_size(TYPE) \
94 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
97 #if defined (__arm__) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
98 /* This is for little-endian machines; small args are padded upward. */
99 #define va_arg(AP, TYPE) \
100 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
101 *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
102 #else /* big-endian */
103 /* This is for big-endian machines; small args are padded downward. */
104 #define va_arg(AP, TYPE) \
105 (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
106 *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \
108 : __va_rounded_size (TYPE))))))
109 #endif /* big-endian */
111 #endif /* not h8300 */
112 #endif /* not alpha */
113 #endif /* not i960 */
114 #endif /* not hppa */
115 #endif /* not m88k */
116 #endif /* not clipper */
118 #endif /* not i860 */
119 #endif /* not mips */
120 #endif /* not spur */
121 #endif /* not sparc */
122 #endif /* not _VARARGS_H */
124 /* Define va_list from __gnuc_va_list. */
126 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
131 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
132 so we must avoid testing it and setting it here.
133 SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
134 have no conflict with that. */
139 #define _VA_LIST va_list
141 #endif /* __i860__ */
142 typedef __gnuc_va_list
va_list ;
143 #endif /* _VA_LIST_ */
145 #else /* not __svr4__ */
147 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
148 But on BSD NET2 we must not test or define or undef it.
149 (Note that the comments in NET 2's ansi.h
150 are incorrect for _VA_LIST_--see stdio.h!) */
151 /* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993:
152 Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
153 use for va_list (``typedef _VA_LIST_ va_list'') */
154 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)
155 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
156 #ifndef _VA_LIST_DEFINED
157 /* The macro _VA_LIST is used in SCO Unix 3.2. */
159 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
162 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
166 #define _VA_LIST_DEFINED
167 typedef __gnuc_va_list
va_list ;
168 #endif /* not _VA_LIST_T_H */
169 #endif /* not _VA_LIST */
170 #endif /* not _VA_LIST_DEFINED */
171 #endif /* not _VA_LIST_, except on certain systems */
173 #endif /* not __svr4__ */
175 /* The next BSD release (if there is one) wants this symbol to be
176 undefined instead of _VA_LIST_. */
This page took 0.044761 seconds and 5 git commands to generate.