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