]>
Commit | Line | Data |
---|---|---|
af13a7a6 BK |
1 | // -*- C++ -*- forwarding header. |
2 | ||
a945c346 | 3 | // Copyright (C) 1997-2024 Free Software Foundation, Inc. |
af13a7a6 BK |
4 | // |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
748086b7 | 8 | // Free Software Foundation; either version 3, or (at your option) |
af13a7a6 BK |
9 | // any later version. |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
748086b7 JJ |
16 | // Under Section 7 of GPL version 3, you are granted additional |
17 | // permissions described in the GCC Runtime Library Exception, version | |
18 | // 3.1, as published by the Free Software Foundation. | |
af13a7a6 | 19 | |
748086b7 JJ |
20 | // You should have received a copy of the GNU General Public License and |
21 | // a copy of the GCC Runtime Library Exception along with this program; | |
22 | // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
23 | // <http://www.gnu.org/licenses/>. | |
af13a7a6 BK |
24 | |
25 | /** @file include/cwchar | |
8e32aa11 | 26 | * This is a Standard C++ Library file. You should @c \#include this file |
2a60a9f6 | 27 | * in your programs, rather than any of the @a *.h implementation files. |
af13a7a6 BK |
28 | * |
29 | * This is the C++ version of the Standard C Library header @c wchar.h, | |
30 | * and its contents are (mostly) the same as that header, but are all | |
31 | * contained in the namespace @c std (except for names which are defined | |
32 | * as macros in C). | |
33 | */ | |
34 | ||
35 | // | |
36 | // ISO C++ 14882: 21.4 | |
37 | // | |
38 | ||
39 | #pragma GCC system_header | |
40 | ||
41 | #include <bits/c++config.h> | |
af13a7a6 BK |
42 | |
43 | #if _GLIBCXX_HAVE_WCHAR_H | |
ddbfe947 | 44 | #include <wchar.h> |
af13a7a6 BK |
45 | #endif |
46 | ||
47 | #ifndef _GLIBCXX_CWCHAR | |
48 | #define _GLIBCXX_CWCHAR 1 | |
49 | ||
50 | // Need to do a bit of trickery here with mbstate_t as char_traits | |
51 | // assumes it is in wchar.h, regardless of wchar_t specializations. | |
52 | #ifndef _GLIBCXX_HAVE_MBSTATE_T | |
53 | extern "C" | |
54 | { | |
55 | typedef struct | |
56 | { | |
57 | int __fill[6]; | |
58 | } mbstate_t; | |
59 | } | |
60 | #endif | |
61 | ||
12ffa228 BK |
62 | namespace std |
63 | { | |
af13a7a6 | 64 | using ::mbstate_t; |
12ffa228 | 65 | } // namespace std |
af13a7a6 BK |
66 | |
67 | // Get rid of those macros defined in <wchar.h> in lieu of real functions. | |
68 | #undef btowc | |
69 | #undef fgetwc | |
70 | #undef fgetws | |
71 | #undef fputwc | |
72 | #undef fputws | |
73 | #undef fwide | |
74 | #undef fwprintf | |
75 | #undef fwscanf | |
76 | #undef getwc | |
77 | #undef getwchar | |
78 | #undef mbrlen | |
79 | #undef mbrtowc | |
80 | #undef mbsinit | |
81 | #undef mbsrtowcs | |
82 | #undef putwc | |
83 | #undef putwchar | |
84 | #undef swprintf | |
85 | #undef swscanf | |
86 | #undef ungetwc | |
87 | #undef vfwprintf | |
88 | #if _GLIBCXX_HAVE_VFWSCANF | |
89 | # undef vfwscanf | |
90 | #endif | |
91 | #undef vswprintf | |
92 | #if _GLIBCXX_HAVE_VSWSCANF | |
93 | # undef vswscanf | |
94 | #endif | |
95 | #undef vwprintf | |
96 | #if _GLIBCXX_HAVE_VWSCANF | |
97 | # undef vwscanf | |
98 | #endif | |
99 | #undef wcrtomb | |
100 | #undef wcscat | |
101 | #undef wcschr | |
102 | #undef wcscmp | |
103 | #undef wcscoll | |
104 | #undef wcscpy | |
105 | #undef wcscspn | |
106 | #undef wcsftime | |
107 | #undef wcslen | |
108 | #undef wcsncat | |
109 | #undef wcsncmp | |
110 | #undef wcsncpy | |
111 | #undef wcspbrk | |
112 | #undef wcsrchr | |
113 | #undef wcsrtombs | |
114 | #undef wcsspn | |
115 | #undef wcsstr | |
116 | #undef wcstod | |
117 | #if _GLIBCXX_HAVE_WCSTOF | |
118 | # undef wcstof | |
119 | #endif | |
120 | #undef wcstok | |
121 | #undef wcstol | |
122 | #undef wcstoul | |
123 | #undef wcsxfrm | |
124 | #undef wctob | |
125 | #undef wmemchr | |
126 | #undef wmemcmp | |
127 | #undef wmemcpy | |
128 | #undef wmemmove | |
129 | #undef wmemset | |
130 | #undef wprintf | |
131 | #undef wscanf | |
132 | ||
133 | #if _GLIBCXX_USE_WCHAR_T | |
134 | ||
daf69489 JW |
135 | extern "C++" |
136 | { | |
12ffa228 BK |
137 | namespace std _GLIBCXX_VISIBILITY(default) |
138 | { | |
2799d972 BK |
139 | _GLIBCXX_BEGIN_NAMESPACE_VERSION |
140 | ||
af13a7a6 BK |
141 | using ::wint_t; |
142 | ||
143 | using ::btowc; | |
144 | using ::fgetwc; | |
145 | using ::fgetws; | |
146 | using ::fputwc; | |
147 | using ::fputws; | |
148 | using ::fwide; | |
149 | using ::fwprintf; | |
150 | using ::fwscanf; | |
151 | using ::getwc; | |
152 | using ::getwchar; | |
153 | using ::mbrlen; | |
154 | using ::mbrtowc; | |
155 | using ::mbsinit; | |
156 | using ::mbsrtowcs; | |
157 | using ::putwc; | |
158 | using ::putwchar; | |
2e0814c8 | 159 | #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF |
af13a7a6 | 160 | using ::swprintf; |
2e0814c8 | 161 | #endif |
af13a7a6 BK |
162 | using ::swscanf; |
163 | using ::ungetwc; | |
164 | using ::vfwprintf; | |
165 | #if _GLIBCXX_HAVE_VFWSCANF | |
166 | using ::vfwscanf; | |
167 | #endif | |
2e0814c8 | 168 | #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF |
af13a7a6 | 169 | using ::vswprintf; |
2e0814c8 | 170 | #endif |
af13a7a6 BK |
171 | #if _GLIBCXX_HAVE_VSWSCANF |
172 | using ::vswscanf; | |
173 | #endif | |
174 | using ::vwprintf; | |
175 | #if _GLIBCXX_HAVE_VWSCANF | |
176 | using ::vwscanf; | |
177 | #endif | |
178 | using ::wcrtomb; | |
179 | using ::wcscat; | |
180 | using ::wcscmp; | |
181 | using ::wcscoll; | |
182 | using ::wcscpy; | |
183 | using ::wcscspn; | |
184 | using ::wcsftime; | |
185 | using ::wcslen; | |
186 | using ::wcsncat; | |
187 | using ::wcsncmp; | |
188 | using ::wcsncpy; | |
189 | using ::wcsrtombs; | |
190 | using ::wcsspn; | |
191 | using ::wcstod; | |
192 | #if _GLIBCXX_HAVE_WCSTOF | |
193 | using ::wcstof; | |
194 | #endif | |
195 | using ::wcstok; | |
196 | using ::wcstol; | |
197 | using ::wcstoul; | |
198 | using ::wcsxfrm; | |
199 | using ::wctob; | |
200 | using ::wmemcmp; | |
201 | using ::wmemcpy; | |
202 | using ::wmemmove; | |
203 | using ::wmemset; | |
204 | using ::wprintf; | |
205 | using ::wscanf; | |
af13a7a6 | 206 | using ::wcschr; |
60822e0b UD |
207 | using ::wcspbrk; |
208 | using ::wcsrchr; | |
209 | using ::wcsstr; | |
210 | using ::wmemchr; | |
af13a7a6 | 211 | |
60822e0b | 212 | #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO |
af13a7a6 BK |
213 | inline wchar_t* |
214 | wcschr(wchar_t* __p, wchar_t __c) | |
215 | { return wcschr(const_cast<const wchar_t*>(__p), __c); } | |
216 | ||
af13a7a6 BK |
217 | inline wchar_t* |
218 | wcspbrk(wchar_t* __s1, const wchar_t* __s2) | |
219 | { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); } | |
220 | ||
af13a7a6 BK |
221 | inline wchar_t* |
222 | wcsrchr(wchar_t* __p, wchar_t __c) | |
223 | { return wcsrchr(const_cast<const wchar_t*>(__p), __c); } | |
224 | ||
af13a7a6 BK |
225 | inline wchar_t* |
226 | wcsstr(wchar_t* __s1, const wchar_t* __s2) | |
227 | { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); } | |
228 | ||
af13a7a6 BK |
229 | inline wchar_t* |
230 | wmemchr(wchar_t* __p, wchar_t __c, size_t __n) | |
231 | { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); } | |
60822e0b | 232 | #endif |
af13a7a6 | 233 | |
12ffa228 BK |
234 | _GLIBCXX_END_NAMESPACE_VERSION |
235 | } // namespace | |
daf69489 | 236 | } // extern "C++" |
af13a7a6 | 237 | |
23c64853 | 238 | #if _GLIBCXX_USE_C99_WCHAR |
af13a7a6 BK |
239 | |
240 | #undef wcstold | |
241 | #undef wcstoll | |
242 | #undef wcstoull | |
243 | ||
12ffa228 BK |
244 | namespace __gnu_cxx |
245 | { | |
af13a7a6 BK |
246 | #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC |
247 | extern "C" long double | |
a85615d2 | 248 | (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw (); |
af13a7a6 BK |
249 | #endif |
250 | #if !_GLIBCXX_USE_C99_DYNAMIC | |
251 | using ::wcstold; | |
252 | #endif | |
253 | #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC | |
254 | extern "C" long long int | |
a85615d2 | 255 | (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); |
af13a7a6 | 256 | extern "C" unsigned long long int |
a85615d2 | 257 | (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); |
af13a7a6 BK |
258 | #endif |
259 | #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC | |
260 | using ::wcstoll; | |
261 | using ::wcstoull; | |
262 | #endif | |
12ffa228 | 263 | } // namespace __gnu_cxx |
af13a7a6 | 264 | |
12ffa228 BK |
265 | namespace std |
266 | { | |
af13a7a6 BK |
267 | using ::__gnu_cxx::wcstold; |
268 | using ::__gnu_cxx::wcstoll; | |
269 | using ::__gnu_cxx::wcstoull; | |
12ffa228 | 270 | } // namespace |
af13a7a6 BK |
271 | |
272 | #endif | |
273 | ||
274 | #endif //_GLIBCXX_USE_WCHAR_T | |
275 | ||
734f5023 | 276 | #if __cplusplus >= 201103L |
53dc5044 PC |
277 | |
278 | #ifdef _GLIBCXX_USE_WCHAR_T | |
279 | ||
12ffa228 BK |
280 | namespace std |
281 | { | |
53dc5044 PC |
282 | #if _GLIBCXX_HAVE_WCSTOF |
283 | using std::wcstof; | |
284 | #endif | |
285 | #if _GLIBCXX_HAVE_VFWSCANF | |
286 | using std::vfwscanf; | |
287 | #endif | |
288 | #if _GLIBCXX_HAVE_VSWSCANF | |
289 | using std::vswscanf; | |
af13a7a6 | 290 | #endif |
53dc5044 PC |
291 | #if _GLIBCXX_HAVE_VWSCANF |
292 | using std::vwscanf; | |
293 | #endif | |
294 | ||
23c64853 | 295 | #if _GLIBCXX_USE_C99_WCHAR |
53dc5044 PC |
296 | using std::wcstold; |
297 | using std::wcstoll; | |
298 | using std::wcstoull; | |
299 | #endif | |
12ffa228 | 300 | } // namespace |
53dc5044 PC |
301 | |
302 | #endif // _GLIBCXX_USE_WCHAR_T | |
303 | ||
734f5023 | 304 | #endif // C++11 |
af13a7a6 BK |
305 | |
306 | #endif |