]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libstdc++-v3/contrib/libstdc++-v3-4.6/include/c_global/cwchar
update
[l4.git] / l4 / pkg / libstdc++-v3 / contrib / libstdc++-v3-4.6 / include / c_global / cwchar
1 // -*- C++ -*- forwarding header.
2
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007, 2008, 2009, 2010
5 // Free Software Foundation, Inc.
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 3, 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 // 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/>.
26
27 /** @file include/cwchar
28  *  This is a Standard C++ Library file.  You should @c \#include this file
29  *  in your programs, rather than any of the @a *.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
33  *  contained in the namespace @c std (except for names which are defined
34  *  as macros in C).
35  */
36
37 //
38 // ISO C++ 14882: 21.4
39 //
40
41 #pragma GCC system_header
42
43 #include <bits/c++config.h>
44
45 #if _GLIBCXX_HAVE_WCHAR_H
46 #include <wchar.h>
47 #endif
48
49 #ifndef _GLIBCXX_CWCHAR
50 #define _GLIBCXX_CWCHAR 1
51
52 // Need to do a bit of trickery here with mbstate_t as char_traits
53 // assumes it is in wchar.h, regardless of wchar_t specializations.
54 #ifndef _GLIBCXX_HAVE_MBSTATE_T
55 extern "C"
56 {
57   typedef struct
58   {
59     int __fill[6];
60   } mbstate_t;
61 }
62 #endif
63
64 namespace std
65 {
66   using ::mbstate_t;
67 } // namespace std
68
69 // Get rid of those macros defined in <wchar.h> in lieu of real functions.
70 #undef btowc
71 #undef fgetwc
72 #undef fgetws
73 #undef fputwc
74 #undef fputws
75 #undef fwide
76 #undef fwprintf
77 #undef fwscanf
78 #undef getwc
79 #undef getwchar
80 #undef mbrlen
81 #undef mbrtowc
82 #undef mbsinit
83 #undef mbsrtowcs
84 #undef putwc
85 #undef putwchar
86 #undef swprintf
87 #undef swscanf
88 #undef ungetwc
89 #undef vfwprintf
90 #if _GLIBCXX_HAVE_VFWSCANF
91 # undef vfwscanf
92 #endif
93 #undef vswprintf
94 #if _GLIBCXX_HAVE_VSWSCANF
95 # undef vswscanf
96 #endif
97 #undef vwprintf
98 #if _GLIBCXX_HAVE_VWSCANF
99 # undef vwscanf
100 #endif
101 #undef wcrtomb
102 #undef wcscat
103 #undef wcschr
104 #undef wcscmp
105 #undef wcscoll
106 #undef wcscpy
107 #undef wcscspn
108 #undef wcsftime
109 #undef wcslen
110 #undef wcsncat
111 #undef wcsncmp
112 #undef wcsncpy
113 #undef wcspbrk
114 #undef wcsrchr
115 #undef wcsrtombs
116 #undef wcsspn
117 #undef wcsstr
118 #undef wcstod
119 #if _GLIBCXX_HAVE_WCSTOF
120 # undef wcstof
121 #endif
122 #undef wcstok
123 #undef wcstol
124 #undef wcstoul
125 #undef wcsxfrm
126 #undef wctob
127 #undef wmemchr
128 #undef wmemcmp
129 #undef wmemcpy
130 #undef wmemmove
131 #undef wmemset
132 #undef wprintf
133 #undef wscanf
134
135 #if _GLIBCXX_USE_WCHAR_T
136
137 namespace std _GLIBCXX_VISIBILITY(default)
138 {
139   using ::wint_t;
140
141   using ::btowc;
142   using ::fgetwc;
143   using ::fgetws;
144   using ::fputwc;
145   using ::fputws;
146   using ::fwide;
147   using ::fwprintf;
148   using ::fwscanf;
149   using ::getwc;
150   using ::getwchar;
151   using ::mbrlen;
152   using ::mbrtowc;
153   using ::mbsinit;
154   using ::mbsrtowcs;
155   using ::putwc;
156   using ::putwchar;
157 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
158   using ::swprintf;
159 #endif
160   using ::swscanf;
161   using ::ungetwc;
162   using ::vfwprintf;
163 #if _GLIBCXX_HAVE_VFWSCANF
164   using ::vfwscanf;
165 #endif
166 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
167   using ::vswprintf;
168 #endif
169 #if _GLIBCXX_HAVE_VSWSCANF
170   using ::vswscanf;
171 #endif
172   using ::vwprintf;
173 #if _GLIBCXX_HAVE_VWSCANF
174   using ::vwscanf;
175 #endif
176   using ::wcrtomb;
177   using ::wcscat;
178   using ::wcscmp;
179   using ::wcscoll;
180   using ::wcscpy;
181   using ::wcscspn;
182   using ::wcsftime;
183   using ::wcslen;
184   using ::wcsncat;
185   using ::wcsncmp;
186   using ::wcsncpy;
187   using ::wcsrtombs;
188   using ::wcsspn;
189   using ::wcstod;
190 #if _GLIBCXX_HAVE_WCSTOF
191   using ::wcstof;
192 #endif
193   using ::wcstok;
194   using ::wcstol;
195   using ::wcstoul;
196   using ::wcsxfrm;
197   using ::wctob;
198   using ::wmemcmp;
199   using ::wmemcpy;
200   using ::wmemmove;
201   using ::wmemset;
202   using ::wprintf;
203   using ::wscanf;
204   using ::wcschr;
205   using ::wcspbrk;
206   using ::wcsrchr;
207   using ::wcsstr;
208   using ::wmemchr;
209
210 _GLIBCXX_BEGIN_NAMESPACE_VERSION
211
212 #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
213   inline wchar_t*
214   wcschr(wchar_t* __p, wchar_t __c)
215   { return wcschr(const_cast<const wchar_t*>(__p), __c); }
216
217   inline wchar_t*
218   wcspbrk(wchar_t* __s1, const wchar_t* __s2)
219   { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
220
221   inline wchar_t*
222   wcsrchr(wchar_t* __p, wchar_t __c)
223   { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
224
225   inline wchar_t*
226   wcsstr(wchar_t* __s1, const wchar_t* __s2)
227   { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
228
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); }
232 #endif
233
234 _GLIBCXX_END_NAMESPACE_VERSION
235 } // namespace
236
237 #if _GLIBCXX_USE_C99
238
239 #undef wcstold
240 #undef wcstoll
241 #undef wcstoull
242
243 namespace __gnu_cxx
244 {
245 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
246   extern "C" long double
247     (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw ();
248 #endif
249 #if !_GLIBCXX_USE_C99_DYNAMIC
250   using ::wcstold;
251 #endif
252 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
253   extern "C" long long int
254     (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
255   extern "C" unsigned long long int
256     (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
257 #endif
258 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
259   using ::wcstoll;
260   using ::wcstoull;
261 #endif
262 } // namespace __gnu_cxx
263
264 namespace std
265 {
266   using ::__gnu_cxx::wcstold;
267   using ::__gnu_cxx::wcstoll;
268   using ::__gnu_cxx::wcstoull;
269 } // namespace
270
271 #endif
272
273 #endif //_GLIBCXX_USE_WCHAR_T
274
275 #ifdef __GXX_EXPERIMENTAL_CXX0X__
276
277 #ifdef _GLIBCXX_USE_WCHAR_T
278
279 namespace std
280 {
281 #if _GLIBCXX_HAVE_WCSTOF
282   using std::wcstof;
283 #endif
284 #if _GLIBCXX_HAVE_VFWSCANF
285   using std::vfwscanf;
286 #endif
287 #if _GLIBCXX_HAVE_VSWSCANF
288   using std::vswscanf;
289 #endif
290 #if _GLIBCXX_HAVE_VWSCANF
291   using std::vwscanf;
292 #endif
293
294 #if _GLIBCXX_USE_C99
295   using std::wcstold;
296   using std::wcstoll;
297   using std::wcstoull;
298 #endif
299 } // namespace
300
301 #endif // _GLIBCXX_USE_WCHAR_T
302
303 #endif // __GXX_EXPERIMENTAL_CXX0X__
304
305 #endif