source: svn/trunk/newcon3bcm2_21bu/toolchain/include/c++/3.4.2/cwchar @ 31

Last change on this file since 31 was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 5.9 KB
Line 
1// -*- C++ -*- forwarding header.
2
3// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
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, 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//
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.
42 */
43
44#ifndef _GLIBCXX_CWCHAR
45#define _GLIBCXX_CWCHAR 1
46
47#pragma GCC system_header
48
49#include <bits/c++config.h>
50#include <cstddef>
51#include <ctime>
52
53#if _GLIBCXX_HAVE_WCHAR_H
54#include <wchar.h>
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.
59#ifndef _GLIBCXX_HAVE_MBSTATE_T
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}
73
74// Get rid of those macros defined in <wchar.h> in lieu of real functions.
75#undef btowc
76#undef fgetwc
77#undef fgetws
78#undef fputwc
79#undef fputws
80#undef fwide
81#undef fwprintf
82#undef fwscanf
83#undef getwc
84#undef getwchar
85#undef mbrlen
86#undef mbrtowc
87#undef mbsinit
88#undef mbsrtowcs
89#undef putwc
90#undef putwchar
91#undef swprintf
92#undef swscanf
93#undef ungetwc
94#undef vfwprintf
95#if _GLIBCXX_HAVE_VFWSCANF
96# undef vfwscanf
97#endif
98#undef vswprintf
99#if _GLIBCXX_HAVE_VSWSCANF
100# undef vswscanf
101#endif
102#undef vwprintf
103#if _GLIBCXX_HAVE_VWSCANF
104# undef vwscanf
105#endif
106#undef wcrtomb
107#undef wcscat
108#undef wcschr
109#undef wcscmp
110#undef wcscoll
111#undef wcscpy
112#undef wcscspn
113#undef wcsftime
114#undef wcslen
115#undef wcsncat
116#undef wcsncmp
117#undef wcsncpy
118#undef wcspbrk
119#undef wcsrchr
120#undef wcsrtombs
121#undef wcsspn
122#undef wcsstr
123#undef wcstod
124#if _GLIBCXX_HAVE_WCSTOF
125# undef wcstof
126#endif
127#undef wcstok
128#undef wcstol
129#undef wcstoul
130#undef wcsxfrm
131#undef wctob
132#undef wmemchr
133#undef wmemcmp
134#undef wmemcpy
135#undef wmemmove
136#undef wmemset
137#undef wprintf
138#undef wscanf
139
140#if _GLIBCXX_USE_WCHAR_T
141namespace std
142{
143  using ::wint_t;
144
145  using ::btowc;
146  using ::fgetwc;
147  using ::fgetws;
148  using ::fputwc;
149  using ::fputws;
150  using ::fwide;
151  using ::fwprintf;
152  using ::fwscanf;
153  using ::getwc;
154  using ::getwchar;
155  using ::mbrlen;
156  using ::mbrtowc;
157  using ::mbsinit;
158  using ::mbsrtowcs;
159  using ::putwc;
160  using ::putwchar;
161  using ::swprintf;
162  using ::swscanf;
163  using ::ungetwc;
164  using ::vfwprintf;
165#if _GLIBCXX_HAVE_VFWSCANF
166  using ::vfwscanf;
167#endif
168  using ::vswprintf;
169#if _GLIBCXX_HAVE_VSWSCANF
170  using ::vswscanf;
171#endif
172  using ::vwprintf;
173#if _GLIBCXX_HAVE_VWSCANF
174  using ::vwscanf;
175#endif
176  using ::wcrtomb;
177  using ::wcscat;
178  using ::wcscmp;
179  using ::wcscoll;
180  using ::wcscpy;
181  using ::wcscspn;
182#if _GLIBCXX_HAVE_WCSFTIME
183  using ::wcsftime;
184#endif
185  using ::wcslen;
186  using ::wcsncat;
187  using ::wcsncmp;
188  using ::wcsncpy;
189  using ::wcsrtombs;
190  using ::wcsspn;
191  using ::wcstod;
192#if _GLIBCXX_HAVE_WCSTOF
193  using ::wcstof;
194#endif
195  using ::wcstok;
196  using ::wcstol;
197  using ::wcstoul;
198  using ::wcsxfrm;
199  using ::wctob;
200  using ::wmemcmp;
201  using ::wmemcpy;
202  using ::wmemmove;
203  using ::wmemset;
204  using ::wprintf;
205  using ::wscanf;
206
207  using ::wcschr;
208
209  inline wchar_t*
210  wcschr(wchar_t* __p, wchar_t __c)
211  { return wcschr(const_cast<const wchar_t*>(__p), __c); }
212
213  using ::wcspbrk;
214
215  inline wchar_t*
216  wcspbrk(wchar_t* __s1, wchar_t* __s2)
217  { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
218
219  using ::wcsrchr;
220
221  inline wchar_t*
222  wcsrchr(wchar_t* __p, wchar_t __c)
223  { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
224
225  using ::wcsstr;
226
227  inline wchar_t*
228  wcsstr(wchar_t* __s1, const wchar_t* __s2)
229  { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
230
231  using ::wmemchr;
232
233  inline wchar_t*
234  wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
235  { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
236}
237
238#if _GLIBCXX_USE_C99
239
240#undef wcstold
241#undef wcstoll
242#undef wcstoull
243
244namespace __gnu_cxx
245{
246#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
247  extern "C" long double
248    (wcstold)(const wchar_t * restrict, wchar_t ** restrict);
249#endif
250#if !_GLIBCXX_USE_C99_DYNAMIC
251  using ::wcstold;
252#endif
253#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
254  extern "C" long long int
255    (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int);
256  extern "C" unsigned long long int
257    (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int);
258#endif
259#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
260  using ::wcstoll;
261  using ::wcstoull;
262#endif
263}
264
265namespace std
266{
267  using __gnu_cxx::wcstold;
268  using __gnu_cxx::wcstoll;
269  using __gnu_cxx::wcstoull;
270}
271#endif
272
273#endif //_GLIBCXX_USE_WCHAR_T
274
275#endif
Note: See TracBrowser for help on using the repository browser.