Install gcc-4.4.0-tdm-1-core-2.tar.gz
[msysgit.git] / mingw / lib / gcc / mingw32 / 4.3.3 / include / c++ / cwchar
blob48b901ddd61e968f0e9ea9b178faf82e6ad8296b
1 // -*- C++ -*- forwarding header.
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007, 2008
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 2, or (at your option)
11 // any later version.
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.
18 // You should have received a copy of the GNU General Public License
19 // along with this library; see the file COPYING.  If not, write to
20 // the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301, USA.
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.
32 /** @file include/cwchar
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
38  *  contained in the namespace @c std (except for names which are defined
39  *  as macros in C).
40  */
43 // ISO C++ 14882: 21.4
46 #pragma GCC system_header
48 #include <bits/c++config.h>
49 #include <cstddef>
51 #if _GLIBCXX_HAVE_WCHAR_H
52 #include <wchar.h>
53 #endif
55 #ifndef _GLIBCXX_CWCHAR
56 #define _GLIBCXX_CWCHAR 1
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.
60 #ifndef _GLIBCXX_HAVE_MBSTATE_T
61 extern "C"
63   typedef struct
64   {
65     int __fill[6];
66   } mbstate_t;
68 #endif
70 _GLIBCXX_BEGIN_NAMESPACE(std)
72   using ::mbstate_t;
74 _GLIBCXX_END_NAMESPACE
76 // Get rid of those macros defined in <wchar.h> in lieu of real functions.
77 #undef btowc
78 #undef fgetwc
79 #undef fgetws
80 #undef fputwc
81 #undef fputws
82 #undef fwide
83 #undef fwprintf
84 #undef fwscanf
85 #undef getwc
86 #undef getwchar
87 #undef mbrlen
88 #undef mbrtowc
89 #undef mbsinit
90 #undef mbsrtowcs
91 #undef putwc
92 #undef putwchar
93 #undef swprintf
94 #undef swscanf
95 #undef ungetwc
96 #undef vfwprintf
97 #if _GLIBCXX_HAVE_VFWSCANF
98 # undef vfwscanf
99 #endif
100 #undef vswprintf
101 #if _GLIBCXX_HAVE_VSWSCANF
102 # undef vswscanf
103 #endif
104 #undef vwprintf
105 #if _GLIBCXX_HAVE_VWSCANF
106 # undef vwscanf
107 #endif
108 #undef wcrtomb
109 #undef wcscat
110 #undef wcschr
111 #undef wcscmp
112 #undef wcscoll
113 #undef wcscpy
114 #undef wcscspn
115 #undef wcsftime
116 #undef wcslen
117 #undef wcsncat
118 #undef wcsncmp
119 #undef wcsncpy
120 #undef wcspbrk
121 #undef wcsrchr
122 #undef wcsrtombs
123 #undef wcsspn
124 #undef wcsstr
125 #undef wcstod
126 #if _GLIBCXX_HAVE_WCSTOF
127 # undef wcstof
128 #endif
129 #undef wcstok
130 #undef wcstol
131 #undef wcstoul
132 #undef wcsxfrm
133 #undef wctob
134 #undef wmemchr
135 #undef wmemcmp
136 #undef wmemcpy
137 #undef wmemmove
138 #undef wmemset
139 #undef wprintf
140 #undef wscanf
142 #if _GLIBCXX_USE_WCHAR_T
144 _GLIBCXX_BEGIN_NAMESPACE(std)
146   using ::wint_t;
148   using ::btowc;
149   using ::fgetwc;
150   using ::fgetws;
151   using ::fputwc;
152   using ::fputws;
153   using ::fwide;
154   using ::fwprintf;
155   using ::fwscanf;
156   using ::getwc;
157   using ::getwchar;
158   using ::mbrlen;
159   using ::mbrtowc;
160   using ::mbsinit;
161   using ::mbsrtowcs;
162   using ::putwc;
163   using ::putwchar;
164   using ::swprintf;
165   using ::swscanf;
166   using ::ungetwc;
167   using ::vfwprintf;
168 #if _GLIBCXX_HAVE_VFWSCANF
169   using ::vfwscanf;
170 #endif
171   using ::vswprintf;
172 #if _GLIBCXX_HAVE_VSWSCANF
173   using ::vswscanf;
174 #endif
175   using ::vwprintf;
176 #if _GLIBCXX_HAVE_VWSCANF
177   using ::vwscanf;
178 #endif
179   using ::wcrtomb;
180   using ::wcscat;
181   using ::wcscmp;
182   using ::wcscoll;
183   using ::wcscpy;
184   using ::wcscspn;
185   using ::wcsftime;
186   using ::wcslen;
187   using ::wcsncat;
188   using ::wcsncmp;
189   using ::wcsncpy;
190   using ::wcsrtombs;
191   using ::wcsspn;
192   using ::wcstod;
193 #if _GLIBCXX_HAVE_WCSTOF
194   using ::wcstof;
195 #endif
196   using ::wcstok;
197   using ::wcstol;
198   using ::wcstoul;
199   using ::wcsxfrm;
200   using ::wctob;
201   using ::wmemcmp;
202   using ::wmemcpy;
203   using ::wmemmove;
204   using ::wmemset;
205   using ::wprintf;
206   using ::wscanf;
208   using ::wcschr;
210   inline wchar_t*
211   wcschr(wchar_t* __p, wchar_t __c)
212   { return wcschr(const_cast<const wchar_t*>(__p), __c); }
214   using ::wcspbrk;
216   inline wchar_t*
217   wcspbrk(wchar_t* __s1, const wchar_t* __s2)
218   { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
220   using ::wcsrchr;
222   inline wchar_t*
223   wcsrchr(wchar_t* __p, wchar_t __c)
224   { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
226   using ::wcsstr;
228   inline wchar_t*
229   wcsstr(wchar_t* __s1, const wchar_t* __s2)
230   { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
232   using ::wmemchr;
234   inline wchar_t*
235   wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
236   { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
238 _GLIBCXX_END_NAMESPACE
240 #if _GLIBCXX_USE_C99
242 #undef wcstold
243 #undef wcstoll
244 #undef wcstoull
246 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
248 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
249   extern "C" long double
250     (wcstold)(const wchar_t * restrict, wchar_t ** restrict);
251 #endif
252 #if !_GLIBCXX_USE_C99_DYNAMIC
253   using ::wcstold;
254 #endif
255 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
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
261 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
262   using ::wcstoll;
263   using ::wcstoull;
264 #endif
266 _GLIBCXX_END_NAMESPACE
268 _GLIBCXX_BEGIN_NAMESPACE(std)
270   using ::__gnu_cxx::wcstold;
271   using ::__gnu_cxx::wcstoll;
272   using ::__gnu_cxx::wcstoull;
274 _GLIBCXX_END_NAMESPACE
276 #endif
278 #endif //_GLIBCXX_USE_WCHAR_T
280 #ifdef __GXX_EXPERIMENTAL_CXX0X__
281 #  if defined(_GLIBCXX_INCLUDE_AS_TR1)
282 #    error C++0x header cannot be included from TR1 header
283 #  endif
284 #  if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
285 #    include <tr1_impl/cwchar>
286 #  else
287 #    define _GLIBCXX_INCLUDE_AS_CXX0X
288 #    define _GLIBCXX_BEGIN_NAMESPACE_TR1
289 #    define _GLIBCXX_END_NAMESPACE_TR1
290 #    define _GLIBCXX_TR1
291 #    include <tr1_impl/cwchar>
292 #    undef _GLIBCXX_TR1
293 #    undef _GLIBCXX_END_NAMESPACE_TR1
294 #    undef _GLIBCXX_BEGIN_NAMESPACE_TR1
295 #    undef _GLIBCXX_INCLUDE_AS_CXX0X
296 #  endif
297 #endif
299 #endif