summaryrefslogtreecommitdiffstats
path: root/gl/wctype.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/wctype.in.h')
-rw-r--r--gl/wctype.in.h368
1 files changed, 251 insertions, 117 deletions
diff --git a/gl/wctype.in.h b/gl/wctype.in.h
index 0f0859c..a7c07d1 100644
--- a/gl/wctype.in.h
+++ b/gl/wctype.in.h
@@ -1,6 +1,6 @@
1/* A substitute for ISO C99 <wctype.h>, for platforms that lack it. 1/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
2 2
3 Copyright (C) 2006-2010 Free Software Foundation, Inc. 3 Copyright (C) 2006-2013 Free Software Foundation, Inc.
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -13,8 +13,7 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation, 16 along with this program; if not, see <http://www.gnu.org/licenses/>. */
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 17
19/* Written by Bruno Haible and Paul Eggert. */ 18/* Written by Bruno Haible and Paul Eggert. */
20 19
@@ -26,11 +25,12 @@
26 * wctrans_t, and wctype_t are not yet implemented. 25 * wctrans_t, and wctype_t are not yet implemented.
27 */ 26 */
28 27
29#ifndef _GL_WCTYPE_H 28#ifndef _@GUARD_PREFIX@_WCTYPE_H
30 29
31#if __GNUC__ >= 3 30#if __GNUC__ >= 3
32@PRAGMA_SYSTEM_HEADER@ 31@PRAGMA_SYSTEM_HEADER@
33#endif 32#endif
33@PRAGMA_COLUMNS@
34 34
35#if @HAVE_WINT_T@ 35#if @HAVE_WINT_T@
36/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. 36/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
@@ -44,6 +44,13 @@
44# include <wchar.h> 44# include <wchar.h>
45#endif 45#endif
46 46
47/* mingw has declarations of towupper and towlower in <ctype.h> as
48 well <wctype.h>. Include <ctype.h> in advance to avoid rpl_ prefix
49 being added to the declarations. */
50#ifdef __MINGW32__
51# include <ctype.h>
52#endif
53
47/* Include the original <wctype.h> if it exists. 54/* Include the original <wctype.h> if it exists.
48 BeOS 5 has the functions but no <wctype.h>. */ 55 BeOS 5 has the functions but no <wctype.h>. */
49/* The include_next requires a split double-inclusion guard. */ 56/* The include_next requires a split double-inclusion guard. */
@@ -51,13 +58,31 @@
51# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@ 58# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
52#endif 59#endif
53 60
54#ifndef _GL_WCTYPE_H 61#ifndef _@GUARD_PREFIX@_WCTYPE_H
55#define _GL_WCTYPE_H 62#define _@GUARD_PREFIX@_WCTYPE_H
63
64_GL_INLINE_HEADER_BEGIN
65#ifndef _GL_WCTYPE_INLINE
66# define _GL_WCTYPE_INLINE _GL_INLINE
67#endif
56 68
57/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 69/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
58 70
59/* The definition of _GL_WARN_ON_USE is copied here. */ 71/* The definition of _GL_WARN_ON_USE is copied here. */
60 72
73/* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
74 #defines a number of identifiers in the application namespace. Revert
75 these #defines. */
76#ifdef __sun
77# undef multibyte
78# undef eucw1
79# undef eucw2
80# undef eucw3
81# undef scrw1
82# undef scrw2
83# undef scrw3
84#endif
85
61/* Define wint_t and WEOF. (Also done in wchar.in.h.) */ 86/* Define wint_t and WEOF. (Also done in wchar.in.h.) */
62#if !@HAVE_WINT_T@ && !defined wint_t 87#if !@HAVE_WINT_T@ && !defined wint_t
63# define wint_t int 88# define wint_t int
@@ -65,153 +90,171 @@
65# define WEOF -1 90# define WEOF -1
66# endif 91# endif
67#else 92#else
93/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
94 This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
95 "unchanged by default argument promotions". Override it. */
96# if defined _MSC_VER
97# if !GNULIB_defined_wint_t
98# include <crtdefs.h>
99typedef unsigned int rpl_wint_t;
100# undef wint_t
101# define wint_t rpl_wint_t
102# define GNULIB_defined_wint_t 1
103# endif
104# endif
68# ifndef WEOF 105# ifndef WEOF
69# define WEOF ((wint_t) -1) 106# define WEOF ((wint_t) -1)
70# endif 107# endif
71#endif 108#endif
72 109
73 110
111#if !GNULIB_defined_wctype_functions
112
74/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions. 113/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
75 Linux libc5 has <wctype.h> and the functions but they are broken. 114 Linux libc5 has <wctype.h> and the functions but they are broken.
76 Assume all 11 functions (all isw* except iswblank) are implemented the 115 Assume all 11 functions (all isw* except iswblank) are implemented the
77 same way, or not at all. */ 116 same way, or not at all. */
78#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@ 117# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
79 118
80/* IRIX 5.3 has macros but no functions, its isw* macros refer to an 119/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
81 undefined variable _ctmp_ and to <ctype.h> macros like _P, and they 120 undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
82 refer to system functions like _iswctype that are not in the 121 refer to system functions like _iswctype that are not in the
83 standard C library. Rather than try to get ancient buggy 122 standard C library. Rather than try to get ancient buggy
84 implementations like this to work, just disable them. */ 123 implementations like this to work, just disable them. */
85# undef iswalnum 124# undef iswalnum
86# undef iswalpha 125# undef iswalpha
87# undef iswblank 126# undef iswblank
88# undef iswcntrl 127# undef iswcntrl
89# undef iswdigit 128# undef iswdigit
90# undef iswgraph 129# undef iswgraph
91# undef iswlower 130# undef iswlower
92# undef iswprint 131# undef iswprint
93# undef iswpunct 132# undef iswpunct
94# undef iswspace 133# undef iswspace
95# undef iswupper 134# undef iswupper
96# undef iswxdigit 135# undef iswxdigit
97# undef towlower 136# undef towlower
98# undef towupper 137# undef towupper
99 138
100/* Linux libc5 has <wctype.h> and the functions but they are broken. */ 139/* Linux libc5 has <wctype.h> and the functions but they are broken. */
101# if @REPLACE_ISWCNTRL@ 140# if @REPLACE_ISWCNTRL@
102# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 141# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
103# define iswalnum rpl_iswalnum 142# define iswalnum rpl_iswalnum
104# define iswalpha rpl_iswalpha 143# define iswalpha rpl_iswalpha
105# define iswblank rpl_iswblank 144# define iswblank rpl_iswblank
106# define iswcntrl rpl_iswcntrl 145# define iswcntrl rpl_iswcntrl
107# define iswdigit rpl_iswdigit 146# define iswdigit rpl_iswdigit
108# define iswgraph rpl_iswgraph 147# define iswgraph rpl_iswgraph
109# define iswlower rpl_iswlower 148# define iswlower rpl_iswlower
110# define iswprint rpl_iswprint 149# define iswprint rpl_iswprint
111# define iswpunct rpl_iswpunct 150# define iswpunct rpl_iswpunct
112# define iswspace rpl_iswspace 151# define iswspace rpl_iswspace
113# define iswupper rpl_iswupper 152# define iswupper rpl_iswupper
114# define iswxdigit rpl_iswxdigit 153# define iswxdigit rpl_iswxdigit
115# define towlower rpl_towlower 154# endif
116# define towupper rpl_towupper 155# endif
156# if @REPLACE_TOWLOWER@
157# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
158# define towlower rpl_towlower
159# define towupper rpl_towupper
160# endif
117# endif 161# endif
118# endif
119 162
120static inline int 163_GL_WCTYPE_INLINE int
121# if @REPLACE_ISWCNTRL@ 164# if @REPLACE_ISWCNTRL@
122rpl_iswalnum 165rpl_iswalnum
123# else 166# else
124iswalnum 167iswalnum
125# endif 168# endif
126 (wint_t wc) 169 (wint_t wc)
127{ 170{
128 return ((wc >= '0' && wc <= '9') 171 return ((wc >= '0' && wc <= '9')
129 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')); 172 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
130} 173}
131 174
132static inline int 175_GL_WCTYPE_INLINE int
133# if @REPLACE_ISWCNTRL@ 176# if @REPLACE_ISWCNTRL@
134rpl_iswalpha 177rpl_iswalpha
135# else 178# else
136iswalpha 179iswalpha
137# endif 180# endif
138 (wint_t wc) 181 (wint_t wc)
139{ 182{
140 return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'; 183 return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
141} 184}
142 185
143static inline int 186_GL_WCTYPE_INLINE int
144# if @REPLACE_ISWCNTRL@ 187# if @REPLACE_ISWCNTRL@
145rpl_iswblank 188rpl_iswblank
146# else 189# else
147iswblank 190iswblank
148# endif 191# endif
149 (wint_t wc) 192 (wint_t wc)
150{ 193{
151 return wc == ' ' || wc == '\t'; 194 return wc == ' ' || wc == '\t';
152} 195}
153 196
154static inline int 197_GL_WCTYPE_INLINE int
155# if @REPLACE_ISWCNTRL@ 198# if @REPLACE_ISWCNTRL@
156rpl_iswcntrl 199rpl_iswcntrl
157# else 200# else
158iswcntrl 201iswcntrl
159# endif 202# endif
160 (wint_t wc) 203 (wint_t wc)
161{ 204{
162 return (wc & ~0x1f) == 0 || wc == 0x7f; 205 return (wc & ~0x1f) == 0 || wc == 0x7f;
163} 206}
164 207
165static inline int 208_GL_WCTYPE_INLINE int
166# if @REPLACE_ISWCNTRL@ 209# if @REPLACE_ISWCNTRL@
167rpl_iswdigit 210rpl_iswdigit
168# else 211# else
169iswdigit 212iswdigit
170# endif 213# endif
171 (wint_t wc) 214 (wint_t wc)
172{ 215{
173 return wc >= '0' && wc <= '9'; 216 return wc >= '0' && wc <= '9';
174} 217}
175 218
176static inline int 219_GL_WCTYPE_INLINE int
177# if @REPLACE_ISWCNTRL@ 220# if @REPLACE_ISWCNTRL@
178rpl_iswgraph 221rpl_iswgraph
179# else 222# else
180iswgraph 223iswgraph
181# endif 224# endif
182 (wint_t wc) 225 (wint_t wc)
183{ 226{
184 return wc >= '!' && wc <= '~'; 227 return wc >= '!' && wc <= '~';
185} 228}
186 229
187static inline int 230_GL_WCTYPE_INLINE int
188# if @REPLACE_ISWCNTRL@ 231# if @REPLACE_ISWCNTRL@
189rpl_iswlower 232rpl_iswlower
190# else 233# else
191iswlower 234iswlower
192# endif 235# endif
193 (wint_t wc) 236 (wint_t wc)
194{ 237{
195 return wc >= 'a' && wc <= 'z'; 238 return wc >= 'a' && wc <= 'z';
196} 239}
197 240
198static inline int 241_GL_WCTYPE_INLINE int
199# if @REPLACE_ISWCNTRL@ 242# if @REPLACE_ISWCNTRL@
200rpl_iswprint 243rpl_iswprint
201# else 244# else
202iswprint 245iswprint
203# endif 246# endif
204 (wint_t wc) 247 (wint_t wc)
205{ 248{
206 return wc >= ' ' && wc <= '~'; 249 return wc >= ' ' && wc <= '~';
207} 250}
208 251
209static inline int 252_GL_WCTYPE_INLINE int
210# if @REPLACE_ISWCNTRL@ 253# if @REPLACE_ISWCNTRL@
211rpl_iswpunct 254rpl_iswpunct
212# else 255# else
213iswpunct 256iswpunct
214# endif 257# endif
215 (wint_t wc) 258 (wint_t wc)
216{ 259{
217 return (wc >= '!' && wc <= '~' 260 return (wc >= '!' && wc <= '~'
@@ -219,75 +262,78 @@ iswpunct
219 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'))); 262 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
220} 263}
221 264
222static inline int 265_GL_WCTYPE_INLINE int
223# if @REPLACE_ISWCNTRL@ 266# if @REPLACE_ISWCNTRL@
224rpl_iswspace 267rpl_iswspace
225# else 268# else
226iswspace 269iswspace
227# endif 270# endif
228 (wint_t wc) 271 (wint_t wc)
229{ 272{
230 return (wc == ' ' || wc == '\t' 273 return (wc == ' ' || wc == '\t'
231 || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r'); 274 || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
232} 275}
233 276
234static inline int 277_GL_WCTYPE_INLINE int
235# if @REPLACE_ISWCNTRL@ 278# if @REPLACE_ISWCNTRL@
236rpl_iswupper 279rpl_iswupper
237# else 280# else
238iswupper 281iswupper
239# endif 282# endif
240 (wint_t wc) 283 (wint_t wc)
241{ 284{
242 return wc >= 'A' && wc <= 'Z'; 285 return wc >= 'A' && wc <= 'Z';
243} 286}
244 287
245static inline int 288_GL_WCTYPE_INLINE int
246# if @REPLACE_ISWCNTRL@ 289# if @REPLACE_ISWCNTRL@
247rpl_iswxdigit 290rpl_iswxdigit
248# else 291# else
249iswxdigit 292iswxdigit
250# endif 293# endif
251 (wint_t wc) 294 (wint_t wc)
252{ 295{
253 return ((wc >= '0' && wc <= '9') 296 return ((wc >= '0' && wc <= '9')
254 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')); 297 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
255} 298}
256 299
257static inline wint_t 300_GL_WCTYPE_INLINE wint_t
258# if @REPLACE_ISWCNTRL@ 301# if @REPLACE_TOWLOWER@
259rpl_towlower 302rpl_towlower
260# else 303# else
261towlower 304towlower
262# endif 305# endif
263 (wint_t wc) 306 (wint_t wc)
264{ 307{
265 return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc); 308 return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
266} 309}
267 310
268static inline wint_t 311_GL_WCTYPE_INLINE wint_t
269# if @REPLACE_ISWCNTRL@ 312# if @REPLACE_TOWLOWER@
270rpl_towupper 313rpl_towupper
271# else 314# else
272towupper 315towupper
273# endif 316# endif
274 (wint_t wc) 317 (wint_t wc)
275{ 318{
276 return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc); 319 return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
277} 320}
278 321
279#elif ! @HAVE_ISWBLANK@ 322# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
280/* Only the iswblank function is missing. */ 323/* Only the iswblank function is missing. */
281 324
282static inline int 325# if @REPLACE_ISWBLANK@
283iswblank (wint_t wc) 326# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
284{ 327# define iswblank rpl_iswblank
285 return wc == ' ' || wc == '\t'; 328# endif
286} 329_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
330# else
331_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
332# endif
287 333
288#endif 334# endif
289 335
290#if defined __MINGW32__ 336# if defined __MINGW32__
291 337
292/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t. 338/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
293 The functions towlower and towupper are implemented in the MSVCRT library 339 The functions towlower and towupper are implemented in the MSVCRT library
@@ -302,30 +348,32 @@ iswblank (wint_t wc)
302 result register. We need to fix this by adding a zero-extend from 348 result register. We need to fix this by adding a zero-extend from
303 wchar_t to wint_t after the call. */ 349 wchar_t to wint_t after the call. */
304 350
305static inline wint_t 351_GL_WCTYPE_INLINE wint_t
306rpl_towlower (wint_t wc) 352rpl_towlower (wint_t wc)
307{ 353{
308 return (wint_t) (wchar_t) towlower (wc); 354 return (wint_t) (wchar_t) towlower (wc);
309} 355}
310# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 356# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
311# define towlower rpl_towlower 357# define towlower rpl_towlower
312# endif 358# endif
313 359
314static inline wint_t 360_GL_WCTYPE_INLINE wint_t
315rpl_towupper (wint_t wc) 361rpl_towupper (wint_t wc)
316{ 362{
317 return (wint_t) (wchar_t) towupper (wc); 363 return (wint_t) (wchar_t) towupper (wc);
318} 364}
319# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 365# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
320# define towupper rpl_towupper 366# define towupper rpl_towupper
321# endif 367# endif
368
369# endif /* __MINGW32__ */
322 370
323#endif /* __MINGW32__ */ 371# define GNULIB_defined_wctype_functions 1
372#endif
324 373
325#if @REPLACE_ISWCNTRL@ 374#if @REPLACE_ISWCNTRL@
326_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc)); 375_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
327_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc)); 376_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
328_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
329_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc)); 377_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
330_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc)); 378_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
331_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc)); 379_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
@@ -338,7 +386,6 @@ _GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
338#else 386#else
339_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc)); 387_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
340_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc)); 388_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
341_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
342_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc)); 389_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
343_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc)); 390_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
344_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc)); 391_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
@@ -351,7 +398,6 @@ _GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
351#endif 398#endif
352_GL_CXXALIASWARN (iswalnum); 399_GL_CXXALIASWARN (iswalnum);
353_GL_CXXALIASWARN (iswalpha); 400_GL_CXXALIASWARN (iswalpha);
354_GL_CXXALIASWARN (iswblank);
355_GL_CXXALIASWARN (iswcntrl); 401_GL_CXXALIASWARN (iswcntrl);
356_GL_CXXALIASWARN (iswdigit); 402_GL_CXXALIASWARN (iswdigit);
357_GL_CXXALIASWARN (iswgraph); 403_GL_CXXALIASWARN (iswgraph);
@@ -362,7 +408,55 @@ _GL_CXXALIASWARN (iswspace);
362_GL_CXXALIASWARN (iswupper); 408_GL_CXXALIASWARN (iswupper);
363_GL_CXXALIASWARN (iswxdigit); 409_GL_CXXALIASWARN (iswxdigit);
364 410
365#if @REPLACE_ISWCNTRL@ || defined __MINGW32__ 411#if @GNULIB_ISWBLANK@
412# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
413_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
414# else
415_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
416# endif
417_GL_CXXALIASWARN (iswblank);
418#endif
419
420#if !@HAVE_WCTYPE_T@
421# if !GNULIB_defined_wctype_t
422typedef void * wctype_t;
423# define GNULIB_defined_wctype_t 1
424# endif
425#endif
426
427/* Get a descriptor for a wide character property. */
428#if @GNULIB_WCTYPE@
429# if !@HAVE_WCTYPE_T@
430_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
431# endif
432_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
433_GL_CXXALIASWARN (wctype);
434#elif defined GNULIB_POSIXCHECK
435# undef wctype
436# if HAVE_RAW_DECL_WCTYPE
437_GL_WARN_ON_USE (wctype, "wctype is unportable - "
438 "use gnulib module wctype for portability");
439# endif
440#endif
441
442/* Test whether a wide character has a given property.
443 The argument WC must be either a wchar_t value or WEOF.
444 The argument DESC must have been returned by the wctype() function. */
445#if @GNULIB_ISWCTYPE@
446# if !@HAVE_WCTYPE_T@
447_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
448# endif
449_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
450_GL_CXXALIASWARN (iswctype);
451#elif defined GNULIB_POSIXCHECK
452# undef iswctype
453# if HAVE_RAW_DECL_ISWCTYPE
454_GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
455 "use gnulib module iswctype for portability");
456# endif
457#endif
458
459#if @REPLACE_TOWLOWER@ || defined __MINGW32__
366_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc)); 460_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
367_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc)); 461_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
368#else 462#else
@@ -372,6 +466,46 @@ _GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
372_GL_CXXALIASWARN (towlower); 466_GL_CXXALIASWARN (towlower);
373_GL_CXXALIASWARN (towupper); 467_GL_CXXALIASWARN (towupper);
374 468
469#if !@HAVE_WCTRANS_T@
470# if !GNULIB_defined_wctrans_t
471typedef void * wctrans_t;
472# define GNULIB_defined_wctrans_t 1
473# endif
474#endif
475
476/* Get a descriptor for a wide character case conversion. */
477#if @GNULIB_WCTRANS@
478# if !@HAVE_WCTRANS_T@
479_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
480# endif
481_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
482_GL_CXXALIASWARN (wctrans);
483#elif defined GNULIB_POSIXCHECK
484# undef wctrans
485# if HAVE_RAW_DECL_WCTRANS
486_GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
487 "use gnulib module wctrans for portability");
488# endif
489#endif
490
491/* Perform a given case conversion on a wide character.
492 The argument WC must be either a wchar_t value or WEOF.
493 The argument DESC must have been returned by the wctrans() function. */
494#if @GNULIB_TOWCTRANS@
495# if !@HAVE_WCTRANS_T@
496_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
497# endif
498_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
499_GL_CXXALIASWARN (towctrans);
500#elif defined GNULIB_POSIXCHECK
501# undef towctrans
502# if HAVE_RAW_DECL_TOWCTRANS
503_GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
504 "use gnulib module towctrans for portability");
505# endif
506#endif
507
508_GL_INLINE_HEADER_END
375 509
376#endif /* _GL_WCTYPE_H */ 510#endif /* _@GUARD_PREFIX@_WCTYPE_H */
377#endif /* _GL_WCTYPE_H */ 511#endif /* _@GUARD_PREFIX@_WCTYPE_H */