]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/include/c_std/std_cwchar.h
std_cctype.h, [...]: Remove trailing whitespace.
[thirdparty/gcc.git] / libstdc++-v3 / include / c_std / std_cwchar.h
CommitLineData
98e6e789 1// -*- C++ -*- forwarding header.
22aef514 2
9c594837 3// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
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
19// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
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
41 * contained in the namespace @c std.
42 */
43
1143680e
SE
44#ifndef _GLIBCXX_CWCHAR
45#define _GLIBCXX_CWCHAR 1
34ff0b99
BK
46
47#pragma GCC system_header
98e6e789
BK
48
49#include <bits/c++config.h>
54c1bf78
BK
50#include <cstddef>
51#include <ctime>
98e6e789 52
3d7c150e 53#if _GLIBCXX_HAVE_WCHAR_H
c0dae541 54#include <wchar.h>
7b331228
BK
55#endif
56
57// Need to do a bit of trickery here with mbstate_t as char_traits
58// assumes it is in wchar.h, regardless of wchar_t specializations.
3d7c150e 59#ifndef _GLIBCXX_HAVE_MBSTATE_T
7b331228
BK
60extern "C"
61{
62 typedef struct
63 {
64 int __fill[6];
65 } mbstate_t;
66}
67#endif
68
69namespace std
70{
71 using ::mbstate_t;
72}
98e6e789
BK
73
74// Get rid of those macros defined in <wchar.h> in lieu of real functions.
de96ac46 75#undef btowc
de96ac46
BK
76#undef fgetwc
77#undef fgetws
78#undef fputwc
79#undef fputws
80#undef fwide
81#undef fwprintf
82#undef fwscanf
8089616e 83#undef getwc
98e6e789 84#undef getwchar
8089616e
BK
85#undef mbrlen
86#undef mbrtowc
68fe6226 87#undef mbsinit
8089616e 88#undef mbsrtowcs
8089616e
BK
89#undef putwc
90#undef putwchar
68fe6226
BK
91#undef swprintf
92#undef swscanf
8089616e 93#undef ungetwc
68fe6226 94#undef vfwprintf
2b1be54b
BS
95#if _GLIBCXX_HAVE_VFWSCANF
96# undef vfwscanf
97#endif
68fe6226 98#undef vswprintf
2b1be54b
BS
99#if _GLIBCXX_HAVE_VSWSCANF
100# undef vswscanf
101#endif
68fe6226 102#undef vwprintf
2b1be54b
BS
103#if _GLIBCXX_HAVE_VWSCANF
104# undef vwscanf
105#endif
8089616e 106#undef wcrtomb
8089616e 107#undef wcscat
68fe6226 108#undef wcschr
8089616e
BK
109#undef wcscmp
110#undef wcscoll
68fe6226 111#undef wcscpy
8089616e 112#undef wcscspn
68fe6226 113#undef wcsftime
8089616e 114#undef wcslen
68fe6226
BK
115#undef wcsncat
116#undef wcsncmp
117#undef wcsncpy
118#undef wcspbrk
119#undef wcsrchr
120#undef wcsrtombs
8089616e 121#undef wcsspn
68fe6226
BK
122#undef wcsstr
123#undef wcstod
2b1be54b
BS
124#if _GLIBCXX_HAVE_WCSTOF
125# undef wcstof
126#endif
8089616e 127#undef wcstok
68fe6226
BK
128#undef wcstol
129#undef wcstoul
130#undef wcsxfrm
131#undef wctob
132#undef wmemchr
8089616e
BK
133#undef wmemcmp
134#undef wmemcpy
135#undef wmemmove
136#undef wmemset
68fe6226
BK
137#undef wprintf
138#undef wscanf
98e6e789 139
3d7c150e 140#if _GLIBCXX_USE_WCHAR_T
98e6e789
BK
141namespace std
142{
143 using ::wint_t;
98e6e789 144
de96ac46 145 using ::btowc;
de96ac46 146 using ::fgetwc;
de96ac46
BK
147 using ::fgetws;
148 using ::fputwc;
149 using ::fputws;
150 using ::fwide;
151 using ::fwprintf;
152 using ::fwscanf;
de96ac46
BK
153 using ::getwc;
154 using ::getwchar;
de96ac46
BK
155 using ::mbrlen;
156 using ::mbrtowc;
68fe6226 157 using ::mbsinit;
de96ac46 158 using ::mbsrtowcs;
de96ac46
BK
159 using ::putwc;
160 using ::putwchar;
68fe6226
BK
161 using ::swprintf;
162 using ::swscanf;
de96ac46 163 using ::ungetwc;
68fe6226 164 using ::vfwprintf;
2b1be54b 165#if _GLIBCXX_HAVE_VFWSCANF
68fe6226 166 using ::vfwscanf;
2b1be54b 167#endif
68fe6226 168 using ::vswprintf;
2b1be54b 169#if _GLIBCXX_HAVE_VSWSCANF
68fe6226 170 using ::vswscanf;
2b1be54b 171#endif
68fe6226 172 using ::vwprintf;
2b1be54b 173#if _GLIBCXX_HAVE_VWSCANF
68fe6226 174 using ::vwscanf;
2b1be54b 175#endif
de96ac46 176 using ::wcrtomb;
de96ac46 177 using ::wcscat;
de96ac46
BK
178 using ::wcscmp;
179 using ::wcscoll;
68fe6226 180 using ::wcscpy;
de96ac46 181 using ::wcscspn;
68fe6226 182 using ::wcsftime;
de96ac46 183 using ::wcslen;
68fe6226
BK
184 using ::wcsncat;
185 using ::wcsncmp;
186 using ::wcsncpy;
187 using ::wcsrtombs;
de96ac46 188 using ::wcsspn;
68fe6226 189 using ::wcstod;
2b1be54b 190#if _GLIBCXX_HAVE_WCSTOF
68fe6226 191 using ::wcstof;
2b1be54b 192#endif
de96ac46 193 using ::wcstok;
68fe6226
BK
194 using ::wcstol;
195 using ::wcstoul;
196 using ::wcsxfrm;
197 using ::wctob;
de96ac46
BK
198 using ::wmemcmp;
199 using ::wmemcpy;
200 using ::wmemmove;
201 using ::wmemset;
68fe6226
BK
202 using ::wprintf;
203 using ::wscanf;
de96ac46
BK
204
205 using ::wcschr;
206
92c3688a
SW
207 inline wchar_t*
208 wcschr(wchar_t* __p, wchar_t __c)
de96ac46
BK
209 { return wcschr(const_cast<const wchar_t*>(__p), __c); }
210
211 using ::wcspbrk;
212
92c3688a
SW
213 inline wchar_t*
214 wcspbrk(wchar_t* __s1, wchar_t* __s2)
de96ac46
BK
215 { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
216
217 using ::wcsrchr;
218
92c3688a
SW
219 inline wchar_t*
220 wcsrchr(wchar_t* __p, wchar_t __c)
de96ac46
BK
221 { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
222
223 using ::wcsstr;
224
92c3688a
SW
225 inline wchar_t*
226 wcsstr(wchar_t* __s1, wchar_t* __s2)
de96ac46
BK
227 { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
228
229 using ::wmemchr;
230
92c3688a
SW
231 inline wchar_t*
232 wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
de96ac46 233 { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
7cda84dc 234}
22aef514 235
3d7c150e 236#if _GLIBCXX_USE_C99
61c71946
BK
237
238#undef wcstold
239#undef wcstoll
240#undef wcstoull
241
3702c634 242namespace __gnu_cxx
7cda84dc 243{
3d7c150e 244#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
9c594837
LR
245 extern "C" long double
246 (wcstold)(const wchar_t * restrict, wchar_t ** restrict);
247#endif
3d7c150e 248#if !_GLIBCXX_USE_C99_DYNAMIC
de96ac46 249 using ::wcstold;
9c594837 250#endif
3d7c150e 251#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
9c594837
LR
252 extern "C" long long int
253 (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int);
254 extern "C" unsigned long long int
255 (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int);
256#endif
3d7c150e 257#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
de96ac46
BK
258 using ::wcstoll;
259 using ::wcstoull;
9c594837 260#endif
98e6e789 261}
5db6f3de
BK
262
263namespace std
264{
3702c634
GDR
265 using __gnu_cxx::wcstold;
266 using __gnu_cxx::wcstoll;
267 using __gnu_cxx::wcstoull;
5db6f3de 268}
7cda84dc
BK
269#endif
270
3d7c150e 271#endif //_GLIBCXX_USE_WCHAR_T
98e6e789 272
98e6e789 273#endif