]>
Commit | Line | Data |
---|---|---|
98e6e789 | 1 | // -*- C++ -*- forwarding header. |
22aef514 | 2 | |
67a7356b PC |
3 | // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
4 | // 2006, 2007 | |
34ff0b99 | 5 | // Free Software Foundation, Inc. |
22aef514 BK |
6 | // |
7 | // This file is part of the GNU ISO C++ Library. This library is free | |
8 | // software; you can redistribute it and/or modify it under the | |
9 | // terms of the GNU General Public License as published by the | |
10 | // Free Software Foundation; either version 2, or (at your option) | |
11 | // any later version. | |
12 | ||
13 | // This library is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | ||
18 | // You should have received a copy of the GNU General Public License along | |
19 | // with this library; see the file COPYING. If not, write to the Free | |
83f51799 | 20 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
22aef514 BK |
21 | // USA. |
22 | ||
23 | // As a special exception, you may use this file as part of a free software | |
24 | // library without restriction. Specifically, if other files instantiate | |
25 | // templates or use macros or inline functions from this file, or you compile | |
26 | // this file and link it with other files to produce an executable, this | |
27 | // file does not by itself cause the resulting executable to be covered by | |
28 | // the GNU General Public License. This exception does not however | |
29 | // invalidate any other reasons why the executable file might be covered by | |
30 | // the GNU General Public License. | |
31 | ||
143c27b0 | 32 | /** @file include/cwchar |
ffe94f83 PE |
33 | * This is a Standard C++ Library file. You should @c #include this file |
34 | * in your programs, rather than any of the "*.h" implementation files. | |
35 | * | |
36 | * This is the C++ version of the Standard C Library header @c wchar.h, | |
37 | * and its contents are (mostly) the same as that header, but are all | |
097588e4 PC |
38 | * contained in the namespace @c std (except for names which are defined |
39 | * as macros in C). | |
ffe94f83 PE |
40 | */ |
41 | ||
143c27b0 BK |
42 | // |
43 | // ISO C++ 14882: 21.4 | |
44 | // | |
45 | ||
1143680e SE |
46 | #ifndef _GLIBCXX_CWCHAR |
47 | #define _GLIBCXX_CWCHAR 1 | |
34ff0b99 BK |
48 | |
49 | #pragma GCC system_header | |
98e6e789 BK |
50 | |
51 | #include <bits/c++config.h> | |
54c1bf78 | 52 | #include <cstddef> |
98e6e789 | 53 | |
3d7c150e | 54 | #if _GLIBCXX_HAVE_WCHAR_H |
c0dae541 | 55 | #include <wchar.h> |
7b331228 BK |
56 | #endif |
57 | ||
58 | // Need to do a bit of trickery here with mbstate_t as char_traits | |
59 | // assumes it is in wchar.h, regardless of wchar_t specializations. | |
3d7c150e | 60 | #ifndef _GLIBCXX_HAVE_MBSTATE_T |
7dd8177f | 61 | extern "C" |
7b331228 | 62 | { |
7dd8177f | 63 | typedef struct |
7b331228 BK |
64 | { |
65 | int __fill[6]; | |
66 | } mbstate_t; | |
67 | } | |
68 | #endif | |
69 | ||
3cbc7af0 BK |
70 | _GLIBCXX_BEGIN_NAMESPACE(std) |
71 | ||
7b331228 | 72 | using ::mbstate_t; |
3cbc7af0 BK |
73 | |
74 | _GLIBCXX_END_NAMESPACE | |
98e6e789 BK |
75 | |
76 | // Get rid of those macros defined in <wchar.h> in lieu of real functions. | |
de96ac46 | 77 | #undef btowc |
de96ac46 BK |
78 | #undef fgetwc |
79 | #undef fgetws | |
80 | #undef fputwc | |
81 | #undef fputws | |
82 | #undef fwide | |
83 | #undef fwprintf | |
84 | #undef fwscanf | |
8089616e | 85 | #undef getwc |
98e6e789 | 86 | #undef getwchar |
8089616e BK |
87 | #undef mbrlen |
88 | #undef mbrtowc | |
68fe6226 | 89 | #undef mbsinit |
8089616e | 90 | #undef mbsrtowcs |
8089616e BK |
91 | #undef putwc |
92 | #undef putwchar | |
68fe6226 BK |
93 | #undef swprintf |
94 | #undef swscanf | |
8089616e | 95 | #undef ungetwc |
68fe6226 | 96 | #undef vfwprintf |
2b1be54b BS |
97 | #if _GLIBCXX_HAVE_VFWSCANF |
98 | # undef vfwscanf | |
7dd8177f | 99 | #endif |
68fe6226 | 100 | #undef vswprintf |
2b1be54b BS |
101 | #if _GLIBCXX_HAVE_VSWSCANF |
102 | # undef vswscanf | |
7dd8177f | 103 | #endif |
68fe6226 | 104 | #undef vwprintf |
2b1be54b BS |
105 | #if _GLIBCXX_HAVE_VWSCANF |
106 | # undef vwscanf | |
7dd8177f | 107 | #endif |
8089616e | 108 | #undef wcrtomb |
8089616e | 109 | #undef wcscat |
68fe6226 | 110 | #undef wcschr |
8089616e BK |
111 | #undef wcscmp |
112 | #undef wcscoll | |
68fe6226 | 113 | #undef wcscpy |
8089616e | 114 | #undef wcscspn |
68fe6226 | 115 | #undef wcsftime |
8089616e | 116 | #undef wcslen |
68fe6226 BK |
117 | #undef wcsncat |
118 | #undef wcsncmp | |
119 | #undef wcsncpy | |
120 | #undef wcspbrk | |
121 | #undef wcsrchr | |
122 | #undef wcsrtombs | |
8089616e | 123 | #undef wcsspn |
68fe6226 BK |
124 | #undef wcsstr |
125 | #undef wcstod | |
2b1be54b BS |
126 | #if _GLIBCXX_HAVE_WCSTOF |
127 | # undef wcstof | |
7dd8177f | 128 | #endif |
8089616e | 129 | #undef wcstok |
68fe6226 BK |
130 | #undef wcstol |
131 | #undef wcstoul | |
132 | #undef wcsxfrm | |
133 | #undef wctob | |
134 | #undef wmemchr | |
8089616e BK |
135 | #undef wmemcmp |
136 | #undef wmemcpy | |
137 | #undef wmemmove | |
138 | #undef wmemset | |
68fe6226 BK |
139 | #undef wprintf |
140 | #undef wscanf | |
98e6e789 | 141 | |
3d7c150e | 142 | #if _GLIBCXX_USE_WCHAR_T |
3cbc7af0 BK |
143 | |
144 | _GLIBCXX_BEGIN_NAMESPACE(std) | |
145 | ||
98e6e789 | 146 | using ::wint_t; |
98e6e789 | 147 | |
de96ac46 | 148 | using ::btowc; |
de96ac46 | 149 | using ::fgetwc; |
de96ac46 BK |
150 | using ::fgetws; |
151 | using ::fputwc; | |
152 | using ::fputws; | |
153 | using ::fwide; | |
154 | using ::fwprintf; | |
155 | using ::fwscanf; | |
de96ac46 BK |
156 | using ::getwc; |
157 | using ::getwchar; | |
de96ac46 BK |
158 | using ::mbrlen; |
159 | using ::mbrtowc; | |
68fe6226 | 160 | using ::mbsinit; |
de96ac46 | 161 | using ::mbsrtowcs; |
de96ac46 BK |
162 | using ::putwc; |
163 | using ::putwchar; | |
68fe6226 BK |
164 | using ::swprintf; |
165 | using ::swscanf; | |
de96ac46 | 166 | using ::ungetwc; |
68fe6226 | 167 | using ::vfwprintf; |
2b1be54b | 168 | #if _GLIBCXX_HAVE_VFWSCANF |
68fe6226 | 169 | using ::vfwscanf; |
7dd8177f | 170 | #endif |
68fe6226 | 171 | using ::vswprintf; |
2b1be54b | 172 | #if _GLIBCXX_HAVE_VSWSCANF |
68fe6226 | 173 | using ::vswscanf; |
7dd8177f | 174 | #endif |
68fe6226 | 175 | using ::vwprintf; |
2b1be54b | 176 | #if _GLIBCXX_HAVE_VWSCANF |
68fe6226 | 177 | using ::vwscanf; |
7dd8177f | 178 | #endif |
de96ac46 | 179 | using ::wcrtomb; |
de96ac46 | 180 | using ::wcscat; |
de96ac46 BK |
181 | using ::wcscmp; |
182 | using ::wcscoll; | |
68fe6226 | 183 | using ::wcscpy; |
de96ac46 | 184 | using ::wcscspn; |
68fe6226 | 185 | using ::wcsftime; |
de96ac46 | 186 | using ::wcslen; |
68fe6226 BK |
187 | using ::wcsncat; |
188 | using ::wcsncmp; | |
189 | using ::wcsncpy; | |
190 | using ::wcsrtombs; | |
de96ac46 | 191 | using ::wcsspn; |
68fe6226 | 192 | using ::wcstod; |
2b1be54b | 193 | #if _GLIBCXX_HAVE_WCSTOF |
68fe6226 | 194 | using ::wcstof; |
7dd8177f | 195 | #endif |
de96ac46 | 196 | using ::wcstok; |
68fe6226 BK |
197 | using ::wcstol; |
198 | using ::wcstoul; | |
199 | using ::wcsxfrm; | |
200 | using ::wctob; | |
de96ac46 BK |
201 | using ::wmemcmp; |
202 | using ::wmemcpy; | |
203 | using ::wmemmove; | |
204 | using ::wmemset; | |
68fe6226 BK |
205 | using ::wprintf; |
206 | using ::wscanf; | |
de96ac46 BK |
207 | |
208 | using ::wcschr; | |
209 | ||
92c3688a SW |
210 | inline wchar_t* |
211 | wcschr(wchar_t* __p, wchar_t __c) | |
de96ac46 BK |
212 | { return wcschr(const_cast<const wchar_t*>(__p), __c); } |
213 | ||
214 | using ::wcspbrk; | |
215 | ||
92c3688a | 216 | inline wchar_t* |
fcc85592 | 217 | wcspbrk(wchar_t* __s1, const wchar_t* __s2) |
de96ac46 BK |
218 | { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); } |
219 | ||
220 | using ::wcsrchr; | |
221 | ||
92c3688a SW |
222 | inline wchar_t* |
223 | wcsrchr(wchar_t* __p, wchar_t __c) | |
de96ac46 BK |
224 | { return wcsrchr(const_cast<const wchar_t*>(__p), __c); } |
225 | ||
226 | using ::wcsstr; | |
227 | ||
92c3688a | 228 | inline wchar_t* |
57945813 | 229 | wcsstr(wchar_t* __s1, const wchar_t* __s2) |
de96ac46 BK |
230 | { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); } |
231 | ||
232 | using ::wmemchr; | |
233 | ||
92c3688a SW |
234 | inline wchar_t* |
235 | wmemchr(wchar_t* __p, wchar_t __c, size_t __n) | |
de96ac46 | 236 | { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); } |
3cbc7af0 BK |
237 | |
238 | _GLIBCXX_END_NAMESPACE | |
22aef514 | 239 | |
3d7c150e | 240 | #if _GLIBCXX_USE_C99 |
61c71946 BK |
241 | |
242 | #undef wcstold | |
243 | #undef wcstoll | |
244 | #undef wcstoull | |
245 | ||
3cbc7af0 BK |
246 | _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) |
247 | ||
3d7c150e | 248 | #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC |
9c594837 LR |
249 | extern "C" long double |
250 | (wcstold)(const wchar_t * restrict, wchar_t ** restrict); | |
251 | #endif | |
3d7c150e | 252 | #if !_GLIBCXX_USE_C99_DYNAMIC |
de96ac46 | 253 | using ::wcstold; |
9c594837 | 254 | #endif |
3d7c150e | 255 | #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC |
9c594837 LR |
256 | extern "C" long long int |
257 | (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int); | |
258 | extern "C" unsigned long long int | |
259 | (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int); | |
260 | #endif | |
3d7c150e | 261 | #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC |
de96ac46 BK |
262 | using ::wcstoll; |
263 | using ::wcstoull; | |
9c594837 | 264 | #endif |
5db6f3de | 265 | |
3cbc7af0 BK |
266 | _GLIBCXX_END_NAMESPACE |
267 | ||
268 | _GLIBCXX_BEGIN_NAMESPACE(std) | |
269 | ||
270 | using ::__gnu_cxx::wcstold; | |
271 | using ::__gnu_cxx::wcstoll; | |
272 | using ::__gnu_cxx::wcstoull; | |
273 | ||
274 | _GLIBCXX_END_NAMESPACE | |
275 | ||
7cda84dc BK |
276 | #endif |
277 | ||
3d7c150e | 278 | #endif //_GLIBCXX_USE_WCHAR_T |
98e6e789 | 279 | |
7dd8177f | 280 | #endif |