]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/include/c_std/std_cwchar.h
std_cmath.h (C99 FP capture): Only undefine said C99 FP macros, if actually captured.
[thirdparty/gcc.git] / libstdc++-v3 / include / c_std / std_cwchar.h
CommitLineData
98e6e789 1// -*- C++ -*- forwarding header.
22aef514 2
34ff0b99
BK
3// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
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
3eb35fcf
BK
44#ifndef _CPP_CWCHAR
45#define _CPP_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
7b331228 53#if _GLIBCPP_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.
59#ifndef _GLIBCPP_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}
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
BK
94#undef vfwprintf
95#undef vfwscanf
96#undef vswprintf
97#undef vswscanf
98#undef vwprintf
99#undef vwscanf
8089616e 100#undef wcrtomb
8089616e 101#undef wcscat
68fe6226 102#undef wcschr
8089616e
BK
103#undef wcscmp
104#undef wcscoll
68fe6226 105#undef wcscpy
8089616e 106#undef wcscspn
68fe6226 107#undef wcsftime
8089616e 108#undef wcslen
68fe6226
BK
109#undef wcsncat
110#undef wcsncmp
111#undef wcsncpy
112#undef wcspbrk
113#undef wcsrchr
114#undef wcsrtombs
8089616e 115#undef wcsspn
68fe6226
BK
116#undef wcsstr
117#undef wcstod
118#undef wcstof
8089616e 119#undef wcstok
68fe6226
BK
120#undef wcstol
121#undef wcstoul
122#undef wcsxfrm
123#undef wctob
124#undef wmemchr
8089616e
BK
125#undef wmemcmp
126#undef wmemcpy
127#undef wmemmove
128#undef wmemset
68fe6226
BK
129#undef wprintf
130#undef wscanf
98e6e789 131
7b331228 132#if _GLIBCPP_USE_WCHAR_T
98e6e789
BK
133namespace std
134{
135 using ::wint_t;
98e6e789 136
de96ac46 137 using ::btowc;
de96ac46 138 using ::fgetwc;
de96ac46
BK
139 using ::fgetws;
140 using ::fputwc;
141 using ::fputws;
142 using ::fwide;
143 using ::fwprintf;
144 using ::fwscanf;
de96ac46
BK
145 using ::getwc;
146 using ::getwchar;
de96ac46
BK
147 using ::mbrlen;
148 using ::mbrtowc;
68fe6226 149 using ::mbsinit;
de96ac46 150 using ::mbsrtowcs;
de96ac46
BK
151 using ::putwc;
152 using ::putwchar;
68fe6226
BK
153 using ::swprintf;
154 using ::swscanf;
de96ac46 155 using ::ungetwc;
68fe6226
BK
156 using ::vfwprintf;
157 using ::vfwscanf;
158 using ::vswprintf;
159 using ::vswscanf;
160 using ::vwprintf;
161 using ::vwscanf;
de96ac46 162 using ::wcrtomb;
de96ac46 163 using ::wcscat;
de96ac46
BK
164 using ::wcscmp;
165 using ::wcscoll;
68fe6226 166 using ::wcscpy;
de96ac46 167 using ::wcscspn;
68fe6226 168 using ::wcsftime;
de96ac46 169 using ::wcslen;
68fe6226
BK
170 using ::wcsncat;
171 using ::wcsncmp;
172 using ::wcsncpy;
173 using ::wcsrtombs;
de96ac46 174 using ::wcsspn;
68fe6226
BK
175 using ::wcstod;
176 using ::wcstof;
de96ac46 177 using ::wcstok;
68fe6226
BK
178 using ::wcstol;
179 using ::wcstoul;
180 using ::wcsxfrm;
181 using ::wctob;
de96ac46
BK
182 using ::wmemcmp;
183 using ::wmemcpy;
184 using ::wmemmove;
185 using ::wmemset;
68fe6226
BK
186 using ::wprintf;
187 using ::wscanf;
de96ac46
BK
188
189 using ::wcschr;
190
92c3688a
SW
191 inline wchar_t*
192 wcschr(wchar_t* __p, wchar_t __c)
de96ac46
BK
193 { return wcschr(const_cast<const wchar_t*>(__p), __c); }
194
195 using ::wcspbrk;
196
92c3688a
SW
197 inline wchar_t*
198 wcspbrk(wchar_t* __s1, wchar_t* __s2)
de96ac46
BK
199 { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
200
201 using ::wcsrchr;
202
92c3688a
SW
203 inline wchar_t*
204 wcsrchr(wchar_t* __p, wchar_t __c)
de96ac46
BK
205 { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
206
207 using ::wcsstr;
208
92c3688a
SW
209 inline wchar_t*
210 wcsstr(wchar_t* __s1, wchar_t* __s2)
de96ac46
BK
211 { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
212
213 using ::wmemchr;
214
92c3688a
SW
215 inline wchar_t*
216 wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
de96ac46 217 { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
7cda84dc 218}
22aef514 219
7cda84dc 220#if _GLIBCPP_USE_C99
61c71946
BK
221
222#undef wcstold
223#undef wcstoll
224#undef wcstoull
225
3702c634 226namespace __gnu_cxx
7cda84dc 227{
de96ac46
BK
228 using ::wcstold;
229 using ::wcstoll;
230 using ::wcstoull;
98e6e789 231}
5db6f3de
BK
232
233namespace std
234{
3702c634
GDR
235 using __gnu_cxx::wcstold;
236 using __gnu_cxx::wcstoll;
237 using __gnu_cxx::wcstoull;
5db6f3de 238}
7cda84dc
BK
239#endif
240
98e6e789
BK
241#endif //_GLIBCPP_USE_WCHAR_T
242
98e6e789 243#endif