]>
Commit | Line | Data |
---|---|---|
83ffe9cd | 1 | /* Copyright (C) 1989-2023 Free Software Foundation, Inc. |
8411a903 | 2 | |
e531258e | 3 | This file is part of GCC. |
fe1dbf6c | 4 | |
e531258e | 5 | GCC is free software; you can redistribute it and/or modify |
fe1dbf6c | 6 | it under the terms of the GNU General Public License as published by |
748086b7 | 7 | the Free Software Foundation; either version 3, or (at your option) |
fe1dbf6c ZW |
8 | any later version. |
9 | ||
e531258e | 10 | GCC is distributed in the hope that it will be useful, |
fe1dbf6c ZW |
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 | ||
748086b7 JJ |
15 | Under Section 7 of GPL version 3, you are granted additional |
16 | permissions described in the GCC Runtime Library Exception, version | |
17 | 3.1, as published by the Free Software Foundation. | |
fe1dbf6c | 18 | |
748086b7 JJ |
19 | You should have received a copy of the GNU General Public License and |
20 | a copy of the GCC Runtime Library Exception along with this program; | |
21 | see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
22 | <http://www.gnu.org/licenses/>. */ | |
fe1dbf6c ZW |
23 | |
24 | /* | |
25 | * ISO C Standard: 7.15 Variable arguments <stdarg.h> | |
26 | */ | |
0dbbbb09 RS |
27 | |
28 | #ifndef _STDARG_H | |
36228d08 | 29 | #ifndef _ANSI_STDARG_H_ |
0a85964e | 30 | #ifndef __need___va_list |
0dbbbb09 | 31 | #define _STDARG_H |
36228d08 | 32 | #define _ANSI_STDARG_H_ |
6ed0be92 | 33 | #endif /* not __need___va_list */ |
0a85964e | 34 | #undef __need___va_list |
0dbbbb09 | 35 | |
0a85964e | 36 | /* Define __gnuc_va_list. */ |
373b5e3b | 37 | |
0a85964e RS |
38 | #ifndef __GNUC_VA_LIST |
39 | #define __GNUC_VA_LIST | |
8411a903 | 40 | typedef __builtin_va_list __gnuc_va_list; |
0a85964e RS |
41 | #endif |
42 | ||
43 | /* Define the standard macros for the user, | |
44 | if this invocation was from the user program. */ | |
a5a9fc56 | 45 | #ifdef _STDARG_H |
0dbbbb09 | 46 | |
4fe34cdc JM |
47 | #if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L |
48 | #define va_start(v, ...) __builtin_va_start(v, 0) | |
49 | #else | |
6c535c69 | 50 | #define va_start(v,l) __builtin_va_start(v,l) |
4fe34cdc | 51 | #endif |
6c535c69 ZW |
52 | #define va_end(v) __builtin_va_end(v) |
53 | #define va_arg(v,l) __builtin_va_arg(v,l) | |
382ead25 JW |
54 | #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L \ |
55 | || __cplusplus + 0 >= 201103L | |
6c535c69 | 56 | #define va_copy(d,s) __builtin_va_copy(d,s) |
223dca6a | 57 | #endif |
6c535c69 | 58 | #define __va_copy(d,s) __builtin_va_copy(d,s) |
0dbbbb09 | 59 | |
0a85964e | 60 | /* Define va_list, if desired, from __gnuc_va_list. */ |
da86800a RS |
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. */ | |
0a85964e | 66 | |
eaec9d17 RS |
67 | #ifdef _BSD_VA_LIST |
68 | #undef _BSD_VA_LIST | |
69 | #endif | |
70 | ||
1997cb46 | 71 | #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) |
eae92d82 | 72 | /* SVR4.2 uses _VA_LIST for an internal alias for va_list, |
b7dd0967 RS |
73 | so we must avoid testing it and setting it here. |
74 | SVR4 uses _VA_LIST as a flag in stdarg.h, but we should | |
75 | have no conflict with that. */ | |
eae92d82 RS |
76 | #ifndef _VA_LIST_ |
77 | #define _VA_LIST_ | |
9dace10d | 78 | #ifdef __i860__ |
51eeee3e | 79 | #ifndef _VA_LIST |
9dace10d RS |
80 | #define _VA_LIST va_list |
81 | #endif | |
51eeee3e | 82 | #endif /* __i860__ */ |
eae92d82 | 83 | typedef __gnuc_va_list va_list; |
1997cb46 RK |
84 | #ifdef _SCO_DS |
85 | #define __VA_LIST | |
86 | #endif | |
eae92d82 | 87 | #endif /* _VA_LIST_ */ |
d33fc50c | 88 | #else /* not __svr4__ || _SCO_DS */ |
eae92d82 | 89 | |
5ce402b7 RS |
90 | /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. |
91 | But on BSD NET2 we must not test or define or undef it. | |
92 | (Note that the comments in NET 2's ansi.h | |
93 | are incorrect for _VA_LIST_--see stdio.h!) */ | |
0f2101cc RK |
94 | #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) |
95 | /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ | |
c4f0e497 | 96 | #ifndef _VA_LIST_DEFINED |
0a85964e RS |
97 | /* The macro _VA_LIST is used in SCO Unix 3.2. */ |
98 | #ifndef _VA_LIST | |
61a2ac12 RS |
99 | /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ |
100 | #ifndef _VA_LIST_T_H | |
512b62fb JM |
101 | /* The macro __va_list__ is used by BeOS. */ |
102 | #ifndef __va_list__ | |
0a85964e | 103 | typedef __gnuc_va_list va_list; |
512b62fb | 104 | #endif /* not __va_list__ */ |
61a2ac12 | 105 | #endif /* not _VA_LIST_T_H */ |
36228d08 | 106 | #endif /* not _VA_LIST */ |
c4f0e497 | 107 | #endif /* not _VA_LIST_DEFINED */ |
0f2101cc RK |
108 | #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) |
109 | #define _VA_LIST_ | |
110 | #endif | |
111 | #ifndef _VA_LIST | |
112 | #define _VA_LIST | |
113 | #endif | |
114 | #ifndef _VA_LIST_DEFINED | |
115 | #define _VA_LIST_DEFINED | |
116 | #endif | |
117 | #ifndef _VA_LIST_T_H | |
118 | #define _VA_LIST_T_H | |
119 | #endif | |
512b62fb JM |
120 | #ifndef __va_list__ |
121 | #define __va_list__ | |
122 | #endif | |
0f2101cc RK |
123 | |
124 | #endif /* not _VA_LIST_, except on certain systems */ | |
d9832c78 | 125 | |
b7dd0967 | 126 | #endif /* not __svr4__ */ |
eae92d82 | 127 | |
9a265c97 JM |
128 | #if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L |
129 | #define __STDC_VERSION_STDARG_H__ 202311L | |
130 | #endif | |
131 | ||
0dbbbb09 | 132 | #endif /* _STDARG_H */ |
0a85964e | 133 | |
36228d08 | 134 | #endif /* not _ANSI_STDARG_H_ */ |
0a85964e | 135 | #endif /* not _STDARG_H */ |