]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/include/c_std/cwchar
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / c_std / cwchar
CommitLineData
98e6e789 1// -*- C++ -*- forwarding header.
22aef514 2
a945c346 3// Copyright (C) 1997-2024 Free Software Foundation, Inc.
22aef514
BK
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
748086b7 8// Free Software Foundation; either version 3, or (at your option)
22aef514
BK
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
748086b7
JJ
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
22aef514 24
143c27b0 25/** @file include/cwchar
ffe94f83 26 * This is a Standard C++ Library file. You should @c #include this file
2a60a9f6 27 * in your programs, rather than any of the @a *.h implementation files.
ffe94f83
PE
28 *
29 * This is the C++ version of the Standard C Library header @c wchar.h,
30 * and its contents are (mostly) the same as that header, but are all
097588e4
PC
31 * contained in the namespace @c std (except for names which are defined
32 * as macros in C).
ffe94f83
PE
33 */
34
143c27b0
BK
35//
36// ISO C++ 14882: 21.4
37//
38
1143680e
SE
39#ifndef _GLIBCXX_CWCHAR
40#define _GLIBCXX_CWCHAR 1
34ff0b99
BK
41
42#pragma GCC system_header
98e6e789
BK
43
44#include <bits/c++config.h>
98e6e789 45
3d7c150e 46#if _GLIBCXX_HAVE_WCHAR_H
c0dae541 47#include <wchar.h>
7b331228
BK
48#endif
49
50// Need to do a bit of trickery here with mbstate_t as char_traits
51// assumes it is in wchar.h, regardless of wchar_t specializations.
3d7c150e 52#ifndef _GLIBCXX_HAVE_MBSTATE_T
7dd8177f 53extern "C"
7b331228 54{
7dd8177f 55 typedef struct
7b331228
BK
56 {
57 int __fill[6];
58 } mbstate_t;
59}
60#endif
61
12ffa228
BK
62namespace std
63{
7b331228 64 using ::mbstate_t;
12ffa228 65} // namespace std
98e6e789
BK
66
67// Get rid of those macros defined in <wchar.h> in lieu of real functions.
de96ac46 68#undef btowc
de96ac46
BK
69#undef fgetwc
70#undef fgetws
71#undef fputwc
72#undef fputws
73#undef fwide
74#undef fwprintf
75#undef fwscanf
8089616e 76#undef getwc
98e6e789 77#undef getwchar
8089616e
BK
78#undef mbrlen
79#undef mbrtowc
68fe6226 80#undef mbsinit
8089616e 81#undef mbsrtowcs
8089616e
BK
82#undef putwc
83#undef putwchar
68fe6226
BK
84#undef swprintf
85#undef swscanf
8089616e 86#undef ungetwc
68fe6226 87#undef vfwprintf
2b1be54b
BS
88#if _GLIBCXX_HAVE_VFWSCANF
89# undef vfwscanf
7dd8177f 90#endif
68fe6226 91#undef vswprintf
2b1be54b
BS
92#if _GLIBCXX_HAVE_VSWSCANF
93# undef vswscanf
7dd8177f 94#endif
68fe6226 95#undef vwprintf
2b1be54b
BS
96#if _GLIBCXX_HAVE_VWSCANF
97# undef vwscanf
7dd8177f 98#endif
8089616e 99#undef wcrtomb
8089616e 100#undef wcscat
68fe6226 101#undef wcschr
8089616e
BK
102#undef wcscmp
103#undef wcscoll
68fe6226 104#undef wcscpy
8089616e 105#undef wcscspn
68fe6226 106#undef wcsftime
8089616e 107#undef wcslen
68fe6226
BK
108#undef wcsncat
109#undef wcsncmp
110#undef wcsncpy
111#undef wcspbrk
112#undef wcsrchr
113#undef wcsrtombs
8089616e 114#undef wcsspn
68fe6226
BK
115#undef wcsstr
116#undef wcstod
2b1be54b
BS
117#if _GLIBCXX_HAVE_WCSTOF
118# undef wcstof
7dd8177f 119#endif
8089616e 120#undef wcstok
68fe6226
BK
121#undef wcstol
122#undef wcstoul
123#undef wcsxfrm
124#undef wctob
125#undef wmemchr
8089616e
BK
126#undef wmemcmp
127#undef wmemcpy
128#undef wmemmove
129#undef wmemset
68fe6226
BK
130#undef wprintf
131#undef wscanf
98e6e789 132
3d7c150e 133#if _GLIBCXX_USE_WCHAR_T
3cbc7af0 134
12ffa228
BK
135namespace std _GLIBCXX_VISIBILITY(default)
136{
137_GLIBCXX_BEGIN_NAMESPACE_VERSION
3cbc7af0 138
98e6e789 139 using ::wint_t;
98e6e789 140
de96ac46 141 using ::btowc;
de96ac46 142 using ::fgetwc;
de96ac46
BK
143 using ::fgetws;
144 using ::fputwc;
145 using ::fputws;
146 using ::fwide;
147 using ::fwprintf;
148 using ::fwscanf;
de96ac46
BK
149 using ::getwc;
150 using ::getwchar;
de96ac46
BK
151 using ::mbrlen;
152 using ::mbrtowc;
68fe6226 153 using ::mbsinit;
de96ac46 154 using ::mbsrtowcs;
de96ac46
BK
155 using ::putwc;
156 using ::putwchar;
68fe6226
BK
157 using ::swprintf;
158 using ::swscanf;
de96ac46 159 using ::ungetwc;
68fe6226 160 using ::vfwprintf;
2b1be54b 161#if _GLIBCXX_HAVE_VFWSCANF
68fe6226 162 using ::vfwscanf;
7dd8177f 163#endif
68fe6226 164 using ::vswprintf;
2b1be54b 165#if _GLIBCXX_HAVE_VSWSCANF
68fe6226 166 using ::vswscanf;
7dd8177f 167#endif
68fe6226 168 using ::vwprintf;
2b1be54b 169#if _GLIBCXX_HAVE_VWSCANF
68fe6226 170 using ::vwscanf;
7dd8177f 171#endif
de96ac46 172 using ::wcrtomb;
de96ac46 173 using ::wcscat;
de96ac46
BK
174 using ::wcscmp;
175 using ::wcscoll;
68fe6226 176 using ::wcscpy;
de96ac46 177 using ::wcscspn;
68fe6226 178 using ::wcsftime;
de96ac46 179 using ::wcslen;
68fe6226
BK
180 using ::wcsncat;
181 using ::wcsncmp;
182 using ::wcsncpy;
183 using ::wcsrtombs;
de96ac46 184 using ::wcsspn;
68fe6226 185 using ::wcstod;
2b1be54b 186#if _GLIBCXX_HAVE_WCSTOF
68fe6226 187 using ::wcstof;
7dd8177f 188#endif
de96ac46 189 using ::wcstok;
68fe6226
BK
190 using ::wcstol;
191 using ::wcstoul;
192 using ::wcsxfrm;
193 using ::wctob;
de96ac46
BK
194 using ::wmemcmp;
195 using ::wmemcpy;
196 using ::wmemmove;
197 using ::wmemset;
68fe6226
BK
198 using ::wprintf;
199 using ::wscanf;
de96ac46 200 using ::wcschr;
60822e0b
UD
201 using ::wcspbrk;
202 using ::wcsrchr;
203 using ::wcsstr;
204 using ::wmemchr;
de96ac46 205
60822e0b 206#ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
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
92c3688a 211 inline wchar_t*
fcc85592 212 wcspbrk(wchar_t* __s1, const wchar_t* __s2)
de96ac46
BK
213 { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
214
92c3688a
SW
215 inline wchar_t*
216 wcsrchr(wchar_t* __p, wchar_t __c)
de96ac46
BK
217 { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
218
92c3688a 219 inline wchar_t*
57945813 220 wcsstr(wchar_t* __s1, const wchar_t* __s2)
de96ac46
BK
221 { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
222
92c3688a
SW
223 inline wchar_t*
224 wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
de96ac46 225 { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
60822e0b 226#endif
3cbc7af0 227
12ffa228
BK
228_GLIBCXX_END_NAMESPACE_VERSION
229} // namespace
22aef514 230
23c64853 231#if _GLIBCXX_USE_C99_WCHAR
61c71946
BK
232
233#undef wcstold
234#undef wcstoll
235#undef wcstoull
236
12ffa228
BK
237namespace __gnu_cxx
238{
3d7c150e 239#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
9c594837 240 extern "C" long double
a85615d2 241 (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw ();
9c594837 242#endif
3d7c150e 243#if !_GLIBCXX_USE_C99_DYNAMIC
de96ac46 244 using ::wcstold;
9c594837 245#endif
3d7c150e 246#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
9c594837 247 extern "C" long long int
a85615d2 248 (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
9c594837 249 extern "C" unsigned long long int
a85615d2 250 (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
9c594837 251#endif
3d7c150e 252#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
de96ac46
BK
253 using ::wcstoll;
254 using ::wcstoull;
9c594837 255#endif
12ffa228 256} // namespace __gnu_cxx
5db6f3de 257
12ffa228
BK
258namespace std
259{
3cbc7af0
BK
260 using ::__gnu_cxx::wcstold;
261 using ::__gnu_cxx::wcstoll;
262 using ::__gnu_cxx::wcstoull;
12ffa228 263} // namespace std
3cbc7af0 264
7cda84dc
BK
265#endif
266
3d7c150e 267#endif //_GLIBCXX_USE_WCHAR_T
98e6e789 268
7dd8177f 269#endif