Print this page
Fix clang errors
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/wchar.h
+++ new/usr/src/head/wchar.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 #ifndef _WCHAR_H
27 27 #define _WCHAR_H
28 28
29 29 #include <sys/feature_tests.h>
30 30 #include <iso/wchar_iso.h>
31 31 #include <iso/wchar_c99.h>
32 32
33 33 /*
34 34 * Allow global visibility for symbols defined in
35 35 * C++ "std" namespace in <iso/wchar_iso.h>.
36 36 */
37 37 #if __cplusplus >= 199711L
38 38 using std::FILE;
39 39 using std::wint_t;
40 40 using std::clock_t;
41 41 using std::size_t;
42 42 using std::time_t;
43 43 using std::tm;
44 44 using std::mbstate_t;
45 45 using std::fgetwc;
46 46 using std::fgetws;
47 47 using std::fputwc;
48 48 using std::fputws;
49 49 using std::ungetwc;
50 50 using std::getwc;
51 51 using std::getwchar;
52 52 using std::putwc;
53 53 using std::putwchar;
54 54 using std::wcstod;
55 55 using std::wcstol;
56 56 using std::wcstoul;
57 57 using std::wcscat;
58 58 using std::wcschr;
59 59 using std::wcscmp;
60 60 using std::wcscoll;
61 61 using std::wcscpy;
62 62 using std::wcscspn;
63 63 using std::wcslen;
64 64 using std::wcsncat;
65 65 using std::wcsncmp;
66 66 using std::wcsncpy;
67 67 using std::wcspbrk;
68 68 using std::wcsrchr;
69 69 using std::wcsspn;
70 70 using std::wcsxfrm;
71 71 using std::wcstok;
72 72 using std::wcsftime;
73 73 /* not XPG4 and not XPG4v2 */
74 74 #if (!defined(_XPG4) && !defined(_XPG4_2) || defined(_XPG5))
75 75 using std::btowc;
76 76 using std::fwprintf;
77 77 using std::fwscanf;
78 78 using std::fwide;
79 79 using std::mbsinit;
80 80 using std::mbrlen;
81 81 using std::mbrtowc;
82 82 using std::mbsrtowcs;
83 83 using std::swprintf;
84 84 using std::swscanf;
85 85 using std::vfwprintf;
86 86 using std::vwprintf;
87 87 using std::vswprintf;
88 88 using std::wcrtomb;
89 89 using std::wcsrtombs;
90 90 using std::wcsstr;
91 91 using std::wctob;
92 92 using std::wmemchr;
93 93 using std::wmemcmp;
94 94 using std::wmemcpy;
95 95 using std::wmemmove;
96 96 using std::wmemset;
97 97 using std::wprintf;
98 98 using std::wscanf;
99 99 #endif /* not XPG4 and not XPG4v2 */
100 100 #endif /* __cplusplus >= 199711L */
101 101
102 102 #ifdef __cplusplus
103 103 extern "C" {
104 104 #endif
105 105
106 106 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
107 107 #if !defined(_WCTYPE_T) || __cplusplus >= 199711L
108 108 #define _WCTYPE_T
109 109 typedef int wctype_t;
110 110 #endif
111 111 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
112 112
113 113 /*
114 114 * XPG6 requires that va_list be defined as defined in <stdarg.h>,
↓ open down ↓ |
114 lines elided |
↑ open up ↑ |
115 115 * however, inclusion of <stdarg.h> breaks Standard C namespace.
116 116 */
117 117 #if defined(_XPG6) && !defined(_VA_LIST)
118 118 #define _VA_LIST
119 119 typedef __va_list va_list;
120 120 #endif /* defined(_XPG6) && !defined(_VA_LIST) */
121 121
122 122 #ifdef __STDC__
123 123
124 124 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
125 +#if __cplusplus >= 199711L
126 +namespace std {
127 +#endif
125 128 extern int iswalpha(wint_t);
126 129 extern int iswupper(wint_t);
127 130 extern int iswlower(wint_t);
128 131 extern int iswdigit(wint_t);
129 132 extern int iswxdigit(wint_t);
130 133 extern int iswalnum(wint_t);
131 134 extern int iswspace(wint_t);
132 135 extern int iswpunct(wint_t);
133 136 extern int iswprint(wint_t);
134 137 extern int iswgraph(wint_t);
135 138 extern int iswcntrl(wint_t);
136 139 extern int iswctype(wint_t, wctype_t);
137 140 extern wint_t towlower(wint_t);
138 141 extern wint_t towupper(wint_t);
139 142 extern wchar_t *wcswcs(const wchar_t *, const wchar_t *);
140 143 extern int wcswidth(const wchar_t *, size_t);
141 144 extern int wcwidth(wchar_t);
142 145 extern wctype_t wctype(const char *);
146 +#if __cplusplus >= 199711L
147 +} /* namespace std */
148 +
149 +using std::iswalpha;
150 +using std::iswupper;
151 +using std::iswlower;
152 +using std::iswdigit;
153 +using std::iswxdigit;
154 +using std::iswalnum;
155 +using std::iswspace;
156 +using std::iswpunct;
157 +using std::iswprint;
158 +using std::iswgraph;
159 +using std::iswcntrl;
160 +using std::iswctype;
161 +using std::towlower;
162 +using std::towupper;
163 +using std::wcswcs;
164 +using std::wcswidth;
165 +using std::wcwidth;
166 +using std::wctype;
167 +#endif
143 168 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
144 169
145 170 #if defined(__EXTENSIONS__) || \
146 171 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
147 172 /* || defined(_XPG7) */
148 173 extern wchar_t *wcsdup(const wchar_t *);
149 174 extern size_t wcsnlen(const wchar_t *, size_t);
150 175 extern wchar_t *wcpcpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
151 176 extern wchar_t *wcpncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
152 177 size_t);
153 178 extern int wcscasecmp(const wchar_t *, const wchar_t *);
154 179 extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
155 180 #endif
156 181
157 182 #else /* __STDC__ */
158 183
159 184 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
160 185 extern int iswalpha();
161 186 extern int iswupper();
162 187 extern int iswlower();
163 188 extern int iswdigit();
164 189 extern int iswxdigit();
165 190 extern int iswalnum();
166 191 extern int iswspace();
167 192 extern int iswpunct();
168 193 extern int iswprint();
169 194 extern int iswgraph();
170 195 extern int iswcntrl();
171 196 extern int iswctype();
172 197 extern wint_t towlower();
173 198 extern wint_t towupper();
174 199 extern wchar_t *wcswcs();
175 200 extern int wcswidth();
176 201 extern int wcwidth();
177 202 extern wctype_t wctype();
178 203 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
179 204
180 205 #if defined(__EXTENSIONS__) || \
181 206 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
182 207 /* || defined(_XPG7) */
183 208 extern wchar_t *wcsdup();
184 209 extern size_t wcsnlen();
185 210 extern wchar_t *wcpcpy();
186 211 extern wchar_t *wcpncpy();
187 212 extern int wcscasecmp();
188 213 extern int wcsncasecmp();
189 214 #endif
190 215
191 216 #endif /* __STDC__ */
192 217
193 218 #ifdef __cplusplus
194 219 }
195 220 #endif
196 221
197 222 #endif /* _WCHAR_H */
↓ open down ↓ |
45 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX