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