]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/gcc/ginclude/varargs.h
This commit was generated by cvs2svn to compensate for changes in r94706,
[FreeBSD/FreeBSD.git] / contrib / gcc / ginclude / varargs.h
1 /* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
2
3 This file is part of GNU CC.
4
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.
9
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.
14
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.  */
19
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.  */
26
27 /* $FreeBSD$ */
28
29 #ifndef _VARARGS_H
30 #define _VARARGS_H
31
32 #ifdef __NeXT__
33
34 /* On Next, erase any vestiges of stdarg.h.  */
35
36 #ifdef _ANSI_STDARG_H_
37 #define _VA_LIST_
38 #endif
39 #define _ANSI_STDARG_H_ 
40
41 #undef va_alist
42 #undef va_dcl
43 #undef va_list
44 #undef va_start
45 #undef va_end
46 #undef va_arg
47 #endif  /* __NeXT__ */
48
49 /* These macros implement traditional (non-ANSI) varargs
50    for GNU C.  */
51
52 #define va_alist  __builtin_va_alist
53
54 /* ??? We don't process attributes correctly in K&R argument context.  */
55 typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
56
57 /* ??? It would be nice to get rid of the ellipsis here.  It causes
58    current_function_varargs to be set in cc1.  */
59 #define va_dcl          __builtin_va_alist_t __builtin_va_alist; ...
60
61 /* Define __gnuc_va_list, just as in stdarg.h.  */
62
63 #ifndef __GNUC_VA_LIST
64 #define __GNUC_VA_LIST
65 typedef __builtin_va_list __gnuc_va_list;
66 #endif
67
68 #define va_start(v)     __builtin_varargs_start((v))
69 #define va_end          __builtin_va_end
70 #define va_arg          __builtin_va_arg
71 #define __va_copy(d,s)  __builtin_va_copy((d),(s))
72
73 /* Define va_list from __gnuc_va_list.  */
74
75 #ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
76 #undef _VA_LIST
77 #endif
78
79 #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
80 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
81    so we must avoid testing it and setting it here.
82    SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
83    have no conflict with that.  */
84 #ifndef _VA_LIST_
85 #define _VA_LIST_
86 #ifdef __i860__
87 #ifndef _VA_LIST
88 #define _VA_LIST va_list
89 #endif
90 #endif /* __i860__ */
91 typedef __gnuc_va_list va_list;
92 #ifdef _SCO_DS
93 #define __VA_LIST
94 #endif
95 #endif /* _VA_LIST_ */
96
97 #else /* not __svr4__  || _SCO_DS */
98
99 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
100    But on BSD NET2 we must not test or define or undef it.
101    (Note that the comments in NET 2's ansi.h
102    are incorrect for _VA_LIST_--see stdio.h!)  */
103 /* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993:
104    Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
105    use for va_list (``typedef _VA_LIST_ va_list'') */
106 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
107 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5  */
108 #ifndef _VA_LIST_DEFINED
109 /* The macro _VA_LIST is used in SCO Unix 3.2.  */
110 #ifndef _VA_LIST
111 /* The macro _VA_LIST_T_H is used in the Bull dpx2  */
112 #ifndef _VA_LIST_T_H
113 /* The macro __va_list__ is used by BeOS.  */
114 #ifndef __va_list__
115 typedef __gnuc_va_list va_list;
116 #endif /* not __va_list__ */
117 #endif /* not _VA_LIST_T_H */
118 #endif /* not _VA_LIST */
119 #endif /* not _VA_LIST_DEFINED */
120 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
121 #define _VA_LIST_
122 #endif
123 #ifndef _VA_LIST
124 #define _VA_LIST
125 #endif
126 #ifndef _VA_LIST_DEFINED
127 #define _VA_LIST_DEFINED
128 #endif
129 #ifndef _VA_LIST_T_H
130 #define _VA_LIST_T_H
131 #endif
132 #ifndef __va_list__
133 #define __va_list__
134 #endif
135
136 #endif /* not _VA_LIST_, except on certain systems */
137
138 #endif /* not __svr4__ */
139
140 /* The next BSD release (if there is one) wants this symbol to be
141    undefined instead of _VA_LIST_.  */
142 #ifdef _BSD_VA_LIST
143 #undef _BSD_VA_LIST
144 #endif
145
146 #endif /* _VARARGS_H */