gcc41 removal: Part 1 of 2: makefiles
[dragonfly.git] / contrib / gcc-4.1 / libstdc++-v3 / include / c_std / std_cwchar.h
1 // -*- C++ -*- forwarding header.
2
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4 // Free Software Foundation, Inc.
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
19 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
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 //
32 // ISO C++ 14882: 21.4
33 //
34
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
41  *  contained in the namespace @c std (except for names which are defined
42  *  as macros in C).
43  */
44
45 #ifndef _GLIBCXX_CWCHAR
46 #define _GLIBCXX_CWCHAR 1
47
48 #pragma GCC system_header
49
50 #include <bits/c++config.h>
51 #include <cstddef>
52 #include <ctime>
53
54 #if _GLIBCXX_HAVE_WCHAR_H
55 #include <wchar.h>
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.
60 #ifndef _GLIBCXX_HAVE_MBSTATE_T
61 extern "C"
62 {
63   typedef struct
64   {
65     int __fill[6];
66   } mbstate_t;
67 }
68 #endif
69
70 namespace std
71 {
72   using ::mbstate_t;
73 }
74
75 // Get rid of those macros defined in <wchar.h> in lieu of real functions.
76 #undef btowc
77 #undef fgetwc
78 #undef fgetws
79 #undef fputwc
80 #undef fputws
81 #undef fwide
82 #undef fwprintf
83 #undef fwscanf
84 #undef getwc
85 #undef getwchar
86 #undef mbrlen
87 #undef mbrtowc
88 #undef mbsinit
89 #undef mbsrtowcs
90 #undef putwc
91 #undef putwchar
92 #undef swprintf
93 #undef swscanf
94 #undef ungetwc
95 #undef vfwprintf
96 #if _GLIBCXX_HAVE_VFWSCANF
97 # undef vfwscanf
98 #endif
99 #undef vswprintf
100 #if _GLIBCXX_HAVE_VSWSCANF
101 # undef vswscanf
102 #endif
103 #undef vwprintf
104 #if _GLIBCXX_HAVE_VWSCANF
105 # undef vwscanf
106 #endif
107 #undef wcrtomb
108 #undef wcscat
109 #undef wcschr
110 #undef wcscmp
111 #undef wcscoll
112 #undef wcscpy
113 #undef wcscspn
114 #undef wcsftime
115 #undef wcslen
116 #undef wcsncat
117 #undef wcsncmp
118 #undef wcsncpy
119 #undef wcspbrk
120 #undef wcsrchr
121 #undef wcsrtombs
122 #undef wcsspn
123 #undef wcsstr
124 #undef wcstod
125 #if _GLIBCXX_HAVE_WCSTOF
126 # undef wcstof
127 #endif
128 #undef wcstok
129 #undef wcstol
130 #undef wcstoul
131 #undef wcsxfrm
132 #undef wctob
133 #undef wmemchr
134 #undef wmemcmp
135 #undef wmemcpy
136 #undef wmemmove
137 #undef wmemset
138 #undef wprintf
139 #undef wscanf
140
141 #if _GLIBCXX_USE_WCHAR_T
142 namespace std
143 {
144   using ::wint_t;
145
146   using ::btowc;
147   using ::fgetwc;
148   using ::fgetws;
149   using ::fputwc;
150   using ::fputws;
151   using ::fwide;
152   using ::fwprintf;
153   using ::fwscanf;
154   using ::getwc;
155   using ::getwchar;
156   using ::mbrlen;
157   using ::mbrtowc;
158   using ::mbsinit;
159   using ::mbsrtowcs;
160   using ::putwc;
161   using ::putwchar;
162   using ::swprintf;
163   using ::swscanf;
164   using ::ungetwc;
165   using ::vfwprintf;
166 #if _GLIBCXX_HAVE_VFWSCANF
167   using ::vfwscanf;
168 #endif
169   using ::vswprintf;
170 #if _GLIBCXX_HAVE_VSWSCANF
171   using ::vswscanf;
172 #endif
173   using ::vwprintf;
174 #if _GLIBCXX_HAVE_VWSCANF
175   using ::vwscanf;
176 #endif
177   using ::wcrtomb;
178   using ::wcscat;
179   using ::wcscmp;
180   using ::wcscoll;
181   using ::wcscpy;
182   using ::wcscspn;
183   using ::wcsftime;
184   using ::wcslen;
185   using ::wcsncat;
186   using ::wcsncmp;
187   using ::wcsncpy;
188   using ::wcsrtombs;
189   using ::wcsspn;
190   using ::wcstod;
191 #if _GLIBCXX_HAVE_WCSTOF
192   using ::wcstof;
193 #endif
194   using ::wcstok;
195   using ::wcstol;
196   using ::wcstoul;
197   using ::wcsxfrm;
198   using ::wctob;
199   using ::wmemcmp;
200   using ::wmemcpy;
201   using ::wmemmove;
202   using ::wmemset;
203   using ::wprintf;
204   using ::wscanf;
205
206   using ::wcschr;
207
208   inline wchar_t*
209   wcschr(wchar_t* __p, wchar_t __c)
210   { return wcschr(const_cast<const wchar_t*>(__p), __c); }
211
212   using ::wcspbrk;
213
214   inline wchar_t*
215   wcspbrk(wchar_t* __s1, const wchar_t* __s2)
216   { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
217
218   using ::wcsrchr;
219
220   inline wchar_t*
221   wcsrchr(wchar_t* __p, wchar_t __c)
222   { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
223
224   using ::wcsstr;
225
226   inline wchar_t*
227   wcsstr(wchar_t* __s1, const wchar_t* __s2)
228   { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
229
230   using ::wmemchr;
231
232   inline wchar_t*
233   wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
234   { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
235 }
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);
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);
255   extern "C" unsigned long long int
256     (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int);
257 #endif
258 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
259   using ::wcstoll;
260   using ::wcstoull;
261 #endif
262 }
263
264 namespace std
265 {
266   using __gnu_cxx::wcstold;
267   using __gnu_cxx::wcstoll;
268   using __gnu_cxx::wcstoull;
269 }
270 #endif
271
272 #endif //_GLIBCXX_USE_WCHAR_T
273
274 #endif