1 // -*- C++ -*- forwarding header.
3 // Copyright (C) 1997-2017 Free Software Foundation, Inc.
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
8 // Free Software Foundation; either version 3, or (at your option)
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.
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.
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/>.
25 /** @file include/cwchar
26 * This is a Standard C++ Library file. You should @c \#include this file
27 * in your programs, rather than any of the @a *.h implementation files.
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
31 * contained in the namespace @c std (except for names which are defined
36 // ISO C++ 14882: 21.4
39 #pragma GCC system_header
41 #include <bits/c++config.h>
43 #if _GLIBCXX_HAVE_WCHAR_H
47 #ifndef _GLIBCXX_CWCHAR
48 #define _GLIBCXX_CWCHAR 1
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.
52 #ifndef _GLIBCXX_HAVE_MBSTATE_T
67 // Get rid of those macros defined in <wchar.h> in lieu of real functions.
88 #if _GLIBCXX_HAVE_VFWSCANF
92 #if _GLIBCXX_HAVE_VSWSCANF
96 #if _GLIBCXX_HAVE_VWSCANF
117 #if _GLIBCXX_HAVE_WCSTOF
133 #if _GLIBCXX_USE_WCHAR_T
135 namespace std _GLIBCXX_VISIBILITY(default)
137 _GLIBCXX_BEGIN_NAMESPACE_VERSION
157 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
163 #if _GLIBCXX_HAVE_VFWSCANF
166 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
169 #if _GLIBCXX_HAVE_VSWSCANF
173 #if _GLIBCXX_HAVE_VWSCANF
190 #if _GLIBCXX_HAVE_WCSTOF
210 #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
212 wcschr(wchar_t* __p, wchar_t __c)
213 { return wcschr(const_cast<const wchar_t*>(__p), __c); }
216 wcspbrk(wchar_t* __s1, const wchar_t* __s2)
217 { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
220 wcsrchr(wchar_t* __p, wchar_t __c)
221 { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
224 wcsstr(wchar_t* __s1, const wchar_t* __s2)
225 { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
228 wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
229 { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
232 _GLIBCXX_END_NAMESPACE_VERSION
235 #if _GLIBCXX_USE_C99_WCHAR
243 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
244 extern "C" long double
245 (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw ();
247 #if !_GLIBCXX_USE_C99_DYNAMIC
250 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
251 extern "C" long long int
252 (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
253 extern "C" unsigned long long int
254 (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
256 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
260 } // namespace __gnu_cxx
264 using ::__gnu_cxx::wcstold;
265 using ::__gnu_cxx::wcstoll;
266 using ::__gnu_cxx::wcstoull;
271 #endif //_GLIBCXX_USE_WCHAR_T
273 #if __cplusplus >= 201103L
275 #ifdef _GLIBCXX_USE_WCHAR_T
279 #if _GLIBCXX_HAVE_WCSTOF
282 #if _GLIBCXX_HAVE_VFWSCANF
285 #if _GLIBCXX_HAVE_VSWSCANF
288 #if _GLIBCXX_HAVE_VWSCANF
292 #if _GLIBCXX_USE_C99_WCHAR
299 #endif // _GLIBCXX_USE_WCHAR_T