Do not generate error message about unrecognised command line switches of
[official-gcc.git] / gcc / ginclude / stdarg.h
blob923ac3c64537bcd5f2a73111cf54a9008a240bc3
1 /* Copyright (C) 1989, 1997, 1998, 1999 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. */
28 * ISO C Standard: 7.15 Variable arguments <stdarg.h>
31 #ifndef _STDARG_H
32 #ifndef _ANSI_STDARG_H_
33 #ifndef __need___va_list
34 #define _STDARG_H
35 #define _ANSI_STDARG_H_
36 #endif /* not __need___va_list */
37 #undef __need___va_list
39 /* Define __gnuc_va_list. */
41 #ifndef __GNUC_VA_LIST
42 #define __GNUC_VA_LIST
43 typedef __builtin_va_list __gnuc_va_list;
44 #endif
46 /* Define the standard macros for the user,
47 if this invocation was from the user program. */
48 #ifdef _STDARG_H
50 /* Note that the type used in va_arg is supposed to match the
51 actual type **after default promotions**.
52 Thus, va_arg (..., short) is not valid. */
54 #define va_start(v,l) __builtin_stdarg_start(&(v),l)
55 #define va_end __builtin_va_end
56 #define va_arg __builtin_va_arg
57 #define va_copy(d,s) __builtin_va_copy(&(d),(s))
60 /* Define va_list, if desired, from __gnuc_va_list. */
61 /* We deliberately do not define va_list when called from
62 stdio.h, because ANSI C says that stdio.h is not supposed to define
63 va_list. stdio.h needs to have access to that data type,
64 but must not use that name. It should use the name __gnuc_va_list,
65 which is safe because it is reserved for the implementation. */
67 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
68 #undef _VA_LIST
69 #endif
71 #ifdef _BSD_VA_LIST
72 #undef _BSD_VA_LIST
73 #endif
75 #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
76 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
77 so we must avoid testing it and setting it here.
78 SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
79 have no conflict with that. */
80 #ifndef _VA_LIST_
81 #define _VA_LIST_
82 #ifdef __i860__
83 #ifndef _VA_LIST
84 #define _VA_LIST va_list
85 #endif
86 #endif /* __i860__ */
87 typedef __gnuc_va_list va_list;
88 #ifdef _SCO_DS
89 #define __VA_LIST
90 #endif
91 #endif /* _VA_LIST_ */
92 #else /* not __svr4__ || _SCO_DS */
94 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
95 But on BSD NET2 we must not test or define or undef it.
96 (Note that the comments in NET 2's ansi.h
97 are incorrect for _VA_LIST_--see stdio.h!) */
98 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
99 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
100 #ifndef _VA_LIST_DEFINED
101 /* The macro _VA_LIST is used in SCO Unix 3.2. */
102 #ifndef _VA_LIST
103 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
104 #ifndef _VA_LIST_T_H
105 typedef __gnuc_va_list va_list;
106 #endif /* not _VA_LIST_T_H */
107 #endif /* not _VA_LIST */
108 #endif /* not _VA_LIST_DEFINED */
109 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
110 #define _VA_LIST_
111 #endif
112 #ifndef _VA_LIST
113 #define _VA_LIST
114 #endif
115 #ifndef _VA_LIST_DEFINED
116 #define _VA_LIST_DEFINED
117 #endif
118 #ifndef _VA_LIST_T_H
119 #define _VA_LIST_T_H
120 #endif
122 #endif /* not _VA_LIST_, except on certain systems */
124 #endif /* not __svr4__ */
126 #endif /* _STDARG_H */
128 #endif /* not _ANSI_STDARG_H_ */
129 #endif /* not _STDARG_H */