Daily bump.
[official-gcc.git] / gcc / ginclude / varargs.h
bloba6136ad93b93b813b4083d555042736ab5532ad5
1 /* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 This file is part of GNU CC.
5 GNU CC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
10 GNU CC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNU CC; see the file COPYING. If not, write to
17 the Free Software Foundation, 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 /* As a special exception, if you include this header file into source
21 files compiled by GCC, this header file does not by itself cause
22 the resulting executable to be covered by the GNU General Public
23 License. This exception does not however invalidate any other
24 reasons why the executable file might be covered by the GNU General
25 Public License. */
27 #ifndef _VARARGS_H
28 #define _VARARGS_H
29 #ifndef RC_INVOKED
31 #ifdef __NeXT__
33 /* On Next, erase any vestiges of stdarg.h. */
35 #ifdef _ANSI_STDARG_H_
36 #define _VA_LIST_
37 #endif
38 #define _ANSI_STDARG_H_
40 #undef va_alist
41 #undef va_dcl
42 #undef va_list
43 #undef va_start
44 #undef va_end
45 #undef va_arg
46 #endif /* __NeXT__ */
48 /* These macros implement traditional (non-ANSI) varargs
49 for GNU C. */
51 #define va_alist __builtin_va_alist
53 /* ??? We don't process attributes correctly in K&R argument context. */
54 typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
56 /* ??? It would be nice to get rid of the ellipsis here. It causes
57 current_function_varargs to be set in cc1. */
58 #define va_dcl __builtin_va_alist_t __builtin_va_alist; ...
60 /* Define __gnuc_va_list, just as in stdarg.h. */
62 #ifndef __GNUC_VA_LIST
63 #define __GNUC_VA_LIST
64 typedef __builtin_va_list __gnuc_va_list;
65 #endif
67 #define va_start(v) __builtin_varargs_start((v))
68 #define va_end __builtin_va_end
69 #define va_arg __builtin_va_arg
70 #define __va_copy(d,s) __builtin_va_copy((d),(s))
72 /* Define va_list from __gnuc_va_list. */
74 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
75 #undef _VA_LIST
76 #endif
78 #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
79 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
80 so we must avoid testing it and setting it here.
81 SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
82 have no conflict with that. */
83 #ifndef _VA_LIST_
84 #define _VA_LIST_
85 #ifdef __i860__
86 #ifndef _VA_LIST
87 #define _VA_LIST va_list
88 #endif
89 #endif /* __i860__ */
90 typedef __gnuc_va_list va_list;
91 #ifdef _SCO_DS
92 #define __VA_LIST
93 #endif
94 #endif /* _VA_LIST_ */
96 #else /* not __svr4__ || _SCO_DS */
98 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
99 But on BSD NET2 we must not test or define or undef it.
100 (Note that the comments in NET 2's ansi.h
101 are incorrect for _VA_LIST_--see stdio.h!) */
102 /* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993:
103 Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
104 use for va_list (``typedef _VA_LIST_ va_list'') */
105 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(__WIN32__)
106 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
107 #ifndef _VA_LIST_DEFINED
108 /* The macro _VA_LIST is used in SCO Unix 3.2. */
109 #ifndef _VA_LIST
110 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
111 #ifndef _VA_LIST_T_H
112 /* The macro __va_list__ is used by BeOS. */
113 #ifndef __va_list__
114 typedef __gnuc_va_list va_list;
115 #endif /* not __va_list__ */
116 #endif /* not _VA_LIST_T_H */
117 #endif /* not _VA_LIST */
118 #endif /* not _VA_LIST_DEFINED */
119 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
120 #define _VA_LIST_
121 #endif
122 #ifndef _VA_LIST
123 #define _VA_LIST
124 #endif
125 #ifndef _VA_LIST_DEFINED
126 #define _VA_LIST_DEFINED
127 #endif
128 #ifndef _VA_LIST_T_H
129 #define _VA_LIST_T_H
130 #endif
131 #ifndef __va_list__
132 #define __va_list__
133 #endif
135 #endif /* not _VA_LIST_, except on certain systems */
137 #endif /* not __svr4__ */
139 /* The next BSD release (if there is one) wants this symbol to be
140 undefined instead of _VA_LIST_. */
141 #ifdef _BSD_VA_LIST
142 #undef _BSD_VA_LIST
143 #endif
145 #endif /* not RC_INVOKED */
146 #endif /* _VARARGS_H */