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