Update Gnulib to the latest git version
[deliverable/binutils-gdb.git] / gnulib / import / wctype.in.h
CommitLineData
8690e634
JK
1/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
2
c0c3707f 3 Copyright (C) 2006-2019 Free Software Foundation, Inc.
8690e634
JK
4
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
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
c0c3707f 16 along with this program; if not, see <https://www.gnu.org/licenses/>. */
8690e634
JK
17
18/* Written by Bruno Haible and Paul Eggert. */
19
20/*
21 * ISO C 99 <wctype.h> for platforms that lack it.
c0c3707f 22 * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wctype.h.html>
8690e634
JK
23 *
24 * iswctype, towctrans, towlower, towupper, wctrans, wctype,
25 * wctrans_t, and wctype_t are not yet implemented.
26 */
27
8690e634
JK
28#if __GNUC__ >= 3
29@PRAGMA_SYSTEM_HEADER@
30#endif
31@PRAGMA_COLUMNS@
32
49e4877c
PA
33#if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__)
34
35/* Special invocation convention:
36 - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of
37 <wctype.h> is being processed, which doesn't include the idempotency
38 guard. */
39
40#@INCLUDE_NEXT@ @NEXT_WCTYPE_H@
41
42#else
43/* Normal invocation convention. */
44
45#ifndef _@GUARD_PREFIX@_WCTYPE_H
46
8690e634
JK
47#if @HAVE_WINT_T@
48/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
49 Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
50 <wchar.h>.
51 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
52 included before <wchar.h>. */
53# include <stddef.h>
54# include <stdio.h>
55# include <time.h>
56# include <wchar.h>
57#endif
58
c0c3707f
CB
59/* Native Windows (mingw, MSVC) have declarations of towupper, towlower, and
60 isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>. Include
61 <ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the
62 declarations. */
63#if defined _WIN32 && ! defined __CYGWIN__
4a626d0a 64# include <ctype.h>
c0c3707f 65# include <wchar.h>
4a626d0a
PA
66#endif
67
8690e634
JK
68/* Include the original <wctype.h> if it exists.
69 BeOS 5 has the functions but no <wctype.h>. */
70/* The include_next requires a split double-inclusion guard. */
71#if @HAVE_WCTYPE_H@
72# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
73#endif
74
75#ifndef _@GUARD_PREFIX@_WCTYPE_H
76#define _@GUARD_PREFIX@_WCTYPE_H
77
4a626d0a
PA
78#ifndef _GL_INLINE_HEADER_BEGIN
79 #error "Please include config.h first."
80#endif
a512b375
JB
81_GL_INLINE_HEADER_BEGIN
82#ifndef _GL_WCTYPE_INLINE
83# define _GL_WCTYPE_INLINE _GL_INLINE
84#endif
85
8690e634
JK
86/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
87
88/* The definition of _GL_WARN_ON_USE is copied here. */
89
90/* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
91 #defines a number of identifiers in the application namespace. Revert
92 these #defines. */
93#ifdef __sun
94# undef multibyte
95# undef eucw1
96# undef eucw2
97# undef eucw3
98# undef scrw1
99# undef scrw2
100# undef scrw3
101#endif
102
103/* Define wint_t and WEOF. (Also done in wchar.in.h.) */
104#if !@HAVE_WINT_T@ && !defined wint_t
105# define wint_t int
106# ifndef WEOF
107# define WEOF -1
108# endif
109#else
c0c3707f
CB
110/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
111 <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
112 wint_t must be "unchanged by default argument promotions". Override it. */
113# if @GNULIB_OVERRIDES_WINT_T@
8690e634 114# if !GNULIB_defined_wint_t
c0c3707f
CB
115# if @HAVE_CRTDEFS_H@
116# include <crtdefs.h>
117# else
118# include <stddef.h>
119# endif
8690e634
JK
120typedef unsigned int rpl_wint_t;
121# undef wint_t
122# define wint_t rpl_wint_t
123# define GNULIB_defined_wint_t 1
124# endif
125# endif
126# ifndef WEOF
127# define WEOF ((wint_t) -1)
128# endif
129#endif
130
131
132#if !GNULIB_defined_wctype_functions
133
134/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
135 Linux libc5 has <wctype.h> and the functions but they are broken.
c0c3707f
CB
136 mingw and MSVC have <wctype.h> and the functions but they take a wchar_t
137 as argument, not an rpl_wint_t.
8690e634
JK
138 Assume all 11 functions (all isw* except iswblank) are implemented the
139 same way, or not at all. */
140# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
141
c0c3707f
CB
142# if @GNULIB_OVERRIDES_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */
143
144_GL_WCTYPE_INLINE int
145rpl_iswalnum (wint_t wc)
146{
147 return ((wchar_t) wc == wc ? iswalnum ((wchar_t) wc) : 0);
148}
149
150_GL_WCTYPE_INLINE int
151rpl_iswalpha (wint_t wc)
152{
153 return ((wchar_t) wc == wc ? iswalpha ((wchar_t) wc) : 0);
154}
155
156_GL_WCTYPE_INLINE int
157rpl_iswblank (wint_t wc)
158{
159 return ((wchar_t) wc == wc ? iswblank ((wchar_t) wc) : 0);
160}
161
162_GL_WCTYPE_INLINE int
163rpl_iswcntrl (wint_t wc)
164{
165 return ((wchar_t) wc == wc ? iswcntrl ((wchar_t) wc) : 0);
166}
167
168_GL_WCTYPE_INLINE int
169rpl_iswdigit (wint_t wc)
170{
171 return ((wchar_t) wc == wc ? iswdigit ((wchar_t) wc) : 0);
172}
173
174_GL_WCTYPE_INLINE int
175rpl_iswgraph (wint_t wc)
176{
177 return ((wchar_t) wc == wc ? iswgraph ((wchar_t) wc) : 0);
178}
179
180_GL_WCTYPE_INLINE int
181rpl_iswlower (wint_t wc)
182{
183 return ((wchar_t) wc == wc ? iswlower ((wchar_t) wc) : 0);
184}
185
186_GL_WCTYPE_INLINE int
187rpl_iswprint (wint_t wc)
188{
189 return ((wchar_t) wc == wc ? iswprint ((wchar_t) wc) : 0);
190}
191
192_GL_WCTYPE_INLINE int
193rpl_iswpunct (wint_t wc)
194{
195 return ((wchar_t) wc == wc ? iswpunct ((wchar_t) wc) : 0);
196}
197
198_GL_WCTYPE_INLINE int
199rpl_iswspace (wint_t wc)
200{
201 return ((wchar_t) wc == wc ? iswspace ((wchar_t) wc) : 0);
202}
203
204_GL_WCTYPE_INLINE int
205rpl_iswupper (wint_t wc)
206{
207 return ((wchar_t) wc == wc ? iswupper ((wchar_t) wc) : 0);
208}
209
210_GL_WCTYPE_INLINE int
211rpl_iswxdigit (wint_t wc)
212{
213 return ((wchar_t) wc == wc ? iswxdigit ((wchar_t) wc) : 0);
214}
215
216_GL_WCTYPE_INLINE wint_t
217rpl_towlower (wint_t wc)
218{
219 return ((wchar_t) wc == wc ? (wchar_t) towlower ((wchar_t) wc) : wc);
220}
221
222_GL_WCTYPE_INLINE wint_t
223rpl_towupper (wint_t wc)
224{
225 return ((wchar_t) wc == wc ? (wchar_t) towupper ((wchar_t) wc) : wc);
226}
8690e634 227
8690e634 228# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
c0c3707f
CB
229# undef iswalnum
230# undef iswalpha
231# undef iswblank
232# undef iswcntrl
233# undef iswdigit
234# undef iswgraph
235# undef iswlower
236# undef iswprint
237# undef iswpunct
238# undef iswspace
239# undef iswupper
240# undef iswxdigit
241# undef towlower
242# undef towupper
8690e634
JK
243# define iswalnum rpl_iswalnum
244# define iswalpha rpl_iswalpha
245# define iswblank rpl_iswblank
246# define iswcntrl rpl_iswcntrl
247# define iswdigit rpl_iswdigit
248# define iswgraph rpl_iswgraph
249# define iswlower rpl_iswlower
250# define iswprint rpl_iswprint
251# define iswpunct rpl_iswpunct
252# define iswspace rpl_iswspace
253# define iswupper rpl_iswupper
254# define iswxdigit rpl_iswxdigit
8690e634
JK
255# define towlower rpl_towlower
256# define towupper rpl_towupper
257# endif
c0c3707f
CB
258
259# else
260
261/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
262 undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
263 refer to system functions like _iswctype that are not in the
264 standard C library. Rather than try to get ancient buggy
265 implementations like this to work, just disable them. */
266# undef iswalnum
267# undef iswalpha
268# undef iswblank
269# undef iswcntrl
270# undef iswdigit
271# undef iswgraph
272# undef iswlower
273# undef iswprint
274# undef iswpunct
275# undef iswspace
276# undef iswupper
277# undef iswxdigit
278# undef towlower
279# undef towupper
280
281/* Linux libc5 has <wctype.h> and the functions but they are broken. */
282# if @REPLACE_ISWCNTRL@
283# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
284# define iswalnum rpl_iswalnum
285# define iswalpha rpl_iswalpha
286# define iswblank rpl_iswblank
287# define iswcntrl rpl_iswcntrl
288# define iswdigit rpl_iswdigit
289# define iswgraph rpl_iswgraph
290# define iswlower rpl_iswlower
291# define iswprint rpl_iswprint
292# define iswpunct rpl_iswpunct
293# define iswspace rpl_iswspace
294# define iswupper rpl_iswupper
295# define iswxdigit rpl_iswxdigit
296# endif
297# endif
298# if @REPLACE_TOWLOWER@
299# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
300# define towlower rpl_towlower
301# define towupper rpl_towupper
302# endif
303# endif
8690e634 304
a512b375 305_GL_WCTYPE_INLINE int
c0c3707f 306# if @REPLACE_ISWCNTRL@
8690e634 307rpl_iswalnum
c0c3707f 308# else
8690e634 309iswalnum
c0c3707f 310# endif
8690e634
JK
311 (wint_t wc)
312{
313 return ((wc >= '0' && wc <= '9')
314 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
315}
316
a512b375 317_GL_WCTYPE_INLINE int
c0c3707f 318# if @REPLACE_ISWCNTRL@
8690e634 319rpl_iswalpha
c0c3707f 320# else
8690e634 321iswalpha
c0c3707f 322# endif
8690e634
JK
323 (wint_t wc)
324{
325 return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
326}
327
a512b375 328_GL_WCTYPE_INLINE int
c0c3707f 329# if @REPLACE_ISWCNTRL@
8690e634 330rpl_iswblank
c0c3707f 331# else
8690e634 332iswblank
c0c3707f 333# endif
8690e634
JK
334 (wint_t wc)
335{
336 return wc == ' ' || wc == '\t';
337}
338
a512b375 339_GL_WCTYPE_INLINE int
c0c3707f 340# if @REPLACE_ISWCNTRL@
8690e634 341rpl_iswcntrl
c0c3707f 342# else
8690e634 343iswcntrl
c0c3707f 344# endif
8690e634
JK
345 (wint_t wc)
346{
347 return (wc & ~0x1f) == 0 || wc == 0x7f;
348}
349
a512b375 350_GL_WCTYPE_INLINE int
c0c3707f 351# if @REPLACE_ISWCNTRL@
8690e634 352rpl_iswdigit
c0c3707f 353# else
8690e634 354iswdigit
c0c3707f 355# endif
8690e634
JK
356 (wint_t wc)
357{
358 return wc >= '0' && wc <= '9';
359}
360
a512b375 361_GL_WCTYPE_INLINE int
c0c3707f 362# if @REPLACE_ISWCNTRL@
8690e634 363rpl_iswgraph
c0c3707f 364# else
8690e634 365iswgraph
c0c3707f 366# endif
8690e634
JK
367 (wint_t wc)
368{
369 return wc >= '!' && wc <= '~';
370}
371
a512b375 372_GL_WCTYPE_INLINE int
c0c3707f 373# if @REPLACE_ISWCNTRL@
8690e634 374rpl_iswlower
c0c3707f 375# else
8690e634 376iswlower
c0c3707f 377# endif
8690e634
JK
378 (wint_t wc)
379{
380 return wc >= 'a' && wc <= 'z';
381}
382
a512b375 383_GL_WCTYPE_INLINE int
c0c3707f 384# if @REPLACE_ISWCNTRL@
8690e634 385rpl_iswprint
c0c3707f 386# else
8690e634 387iswprint
c0c3707f 388# endif
8690e634
JK
389 (wint_t wc)
390{
391 return wc >= ' ' && wc <= '~';
392}
393
a512b375 394_GL_WCTYPE_INLINE int
c0c3707f 395# if @REPLACE_ISWCNTRL@
8690e634 396rpl_iswpunct
c0c3707f 397# else
8690e634 398iswpunct
c0c3707f 399# endif
8690e634
JK
400 (wint_t wc)
401{
402 return (wc >= '!' && wc <= '~'
403 && !((wc >= '0' && wc <= '9')
404 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
405}
406
a512b375 407_GL_WCTYPE_INLINE int
c0c3707f 408# if @REPLACE_ISWCNTRL@
8690e634 409rpl_iswspace
c0c3707f 410# else
8690e634 411iswspace
c0c3707f 412# endif
8690e634
JK
413 (wint_t wc)
414{
415 return (wc == ' ' || wc == '\t'
416 || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
417}
418
a512b375 419_GL_WCTYPE_INLINE int
c0c3707f 420# if @REPLACE_ISWCNTRL@
8690e634 421rpl_iswupper
c0c3707f 422# else
8690e634 423iswupper
c0c3707f 424# endif
8690e634
JK
425 (wint_t wc)
426{
427 return wc >= 'A' && wc <= 'Z';
428}
429
a512b375 430_GL_WCTYPE_INLINE int
c0c3707f 431# if @REPLACE_ISWCNTRL@
8690e634 432rpl_iswxdigit
c0c3707f 433# else
8690e634 434iswxdigit
c0c3707f 435# endif
8690e634
JK
436 (wint_t wc)
437{
438 return ((wc >= '0' && wc <= '9')
439 || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
440}
441
a512b375 442_GL_WCTYPE_INLINE wint_t
c0c3707f 443# if @REPLACE_TOWLOWER@
8690e634 444rpl_towlower
c0c3707f 445# else
8690e634 446towlower
c0c3707f 447# endif
8690e634
JK
448 (wint_t wc)
449{
450 return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
451}
452
a512b375 453_GL_WCTYPE_INLINE wint_t
c0c3707f 454# if @REPLACE_TOWLOWER@
8690e634 455rpl_towupper
c0c3707f 456# else
8690e634 457towupper
c0c3707f 458# endif
8690e634
JK
459 (wint_t wc)
460{
461 return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
462}
463
c0c3707f
CB
464# endif
465
8690e634
JK
466# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
467/* Only the iswblank function is missing. */
468
469# if @REPLACE_ISWBLANK@
470# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
471# define iswblank rpl_iswblank
472# endif
473_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
474# else
475_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
476# endif
477
478# endif
479
c0c3707f 480# if defined __MINGW32__ && !@GNULIB_OVERRIDES_WINT_T@
8690e634
JK
481
482/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
483 The functions towlower and towupper are implemented in the MSVCRT library
484 to take a wchar_t argument and return a wchar_t result. mingw declares
485 these functions to take a wint_t argument and return a wint_t result.
486 This means that:
487 1. When the user passes an argument outside the range 0x0000..0xFFFF, the
488 function will look only at the lower 16 bits. This is allowed according
489 to POSIX.
490 2. The return value is returned in the lower 16 bits of the result register.
491 The upper 16 bits are random: whatever happened to be in that part of the
492 result register. We need to fix this by adding a zero-extend from
493 wchar_t to wint_t after the call. */
494
a512b375 495_GL_WCTYPE_INLINE wint_t
8690e634
JK
496rpl_towlower (wint_t wc)
497{
498 return (wint_t) (wchar_t) towlower (wc);
499}
500# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
501# define towlower rpl_towlower
502# endif
503
a512b375 504_GL_WCTYPE_INLINE wint_t
8690e634
JK
505rpl_towupper (wint_t wc)
506{
507 return (wint_t) (wchar_t) towupper (wc);
508}
509# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
510# define towupper rpl_towupper
511# endif
512
c0c3707f 513# endif /* __MINGW32__ && !@GNULIB_OVERRIDES_WINT_T@ */
8690e634
JK
514
515# define GNULIB_defined_wctype_functions 1
516#endif
517
518#if @REPLACE_ISWCNTRL@
519_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
520_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
521_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
522_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
523_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
524_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
525_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
526_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
527_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
528_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
529_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
530#else
531_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
532_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
533_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
534_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
535_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
536_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
537_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
538_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
539_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
540_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
541_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
542#endif
c0c3707f 543#if __GLIBC__ >= 2
8690e634
JK
544_GL_CXXALIASWARN (iswalnum);
545_GL_CXXALIASWARN (iswalpha);
546_GL_CXXALIASWARN (iswcntrl);
547_GL_CXXALIASWARN (iswdigit);
548_GL_CXXALIASWARN (iswgraph);
549_GL_CXXALIASWARN (iswlower);
550_GL_CXXALIASWARN (iswprint);
551_GL_CXXALIASWARN (iswpunct);
552_GL_CXXALIASWARN (iswspace);
553_GL_CXXALIASWARN (iswupper);
554_GL_CXXALIASWARN (iswxdigit);
c0c3707f 555#endif
8690e634
JK
556
557#if @GNULIB_ISWBLANK@
558# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
559_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
560# else
561_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
562# endif
c0c3707f 563# if __GLIBC__ >= 2
8690e634 564_GL_CXXALIASWARN (iswblank);
c0c3707f 565# endif
8690e634
JK
566#endif
567
568#if !@HAVE_WCTYPE_T@
569# if !GNULIB_defined_wctype_t
570typedef void * wctype_t;
571# define GNULIB_defined_wctype_t 1
572# endif
573#endif
574
575/* Get a descriptor for a wide character property. */
576#if @GNULIB_WCTYPE@
577# if !@HAVE_WCTYPE_T@
578_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
579# endif
580_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
c0c3707f 581# if __GLIBC__ >= 2
8690e634 582_GL_CXXALIASWARN (wctype);
c0c3707f 583# endif
8690e634
JK
584#elif defined GNULIB_POSIXCHECK
585# undef wctype
586# if HAVE_RAW_DECL_WCTYPE
587_GL_WARN_ON_USE (wctype, "wctype is unportable - "
588 "use gnulib module wctype for portability");
589# endif
590#endif
591
592/* Test whether a wide character has a given property.
593 The argument WC must be either a wchar_t value or WEOF.
594 The argument DESC must have been returned by the wctype() function. */
595#if @GNULIB_ISWCTYPE@
c0c3707f
CB
596# if @GNULIB_OVERRIDES_WINT_T@
597# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
598# undef iswctype
599# define iswctype rpl_iswctype
600# endif
601_GL_FUNCDECL_RPL (iswctype, int, (wint_t wc, wctype_t desc));
602_GL_CXXALIAS_RPL (iswctype, int, (wint_t wc, wctype_t desc));
603# else
604# if !@HAVE_WCTYPE_T@
8690e634 605_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
c0c3707f 606# endif
8690e634 607_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
c0c3707f
CB
608# endif
609# if __GLIBC__ >= 2
8690e634 610_GL_CXXALIASWARN (iswctype);
c0c3707f 611# endif
8690e634
JK
612#elif defined GNULIB_POSIXCHECK
613# undef iswctype
614# if HAVE_RAW_DECL_ISWCTYPE
615_GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
616 "use gnulib module iswctype for portability");
617# endif
618#endif
619
620#if @REPLACE_TOWLOWER@ || defined __MINGW32__
621_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
622_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
623#else
624_GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
625_GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
626#endif
c0c3707f 627#if __GLIBC__ >= 2
8690e634
JK
628_GL_CXXALIASWARN (towlower);
629_GL_CXXALIASWARN (towupper);
c0c3707f 630#endif
8690e634
JK
631
632#if !@HAVE_WCTRANS_T@
633# if !GNULIB_defined_wctrans_t
634typedef void * wctrans_t;
635# define GNULIB_defined_wctrans_t 1
636# endif
637#endif
638
639/* Get a descriptor for a wide character case conversion. */
640#if @GNULIB_WCTRANS@
641# if !@HAVE_WCTRANS_T@
642_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
643# endif
644_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
c0c3707f 645# if __GLIBC__ >= 2
8690e634 646_GL_CXXALIASWARN (wctrans);
c0c3707f 647# endif
8690e634
JK
648#elif defined GNULIB_POSIXCHECK
649# undef wctrans
650# if HAVE_RAW_DECL_WCTRANS
651_GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
652 "use gnulib module wctrans for portability");
653# endif
654#endif
655
656/* Perform a given case conversion on a wide character.
657 The argument WC must be either a wchar_t value or WEOF.
658 The argument DESC must have been returned by the wctrans() function. */
659#if @GNULIB_TOWCTRANS@
660# if !@HAVE_WCTRANS_T@
661_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
662# endif
663_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
c0c3707f 664# if __GLIBC__ >= 2
8690e634 665_GL_CXXALIASWARN (towctrans);
c0c3707f 666# endif
8690e634
JK
667#elif defined GNULIB_POSIXCHECK
668# undef towctrans
669# if HAVE_RAW_DECL_TOWCTRANS
670_GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
671 "use gnulib module towctrans for portability");
672# endif
673#endif
674
a512b375 675_GL_INLINE_HEADER_END
8690e634
JK
676
677#endif /* _@GUARD_PREFIX@_WCTYPE_H */
678#endif /* _@GUARD_PREFIX@_WCTYPE_H */
49e4877c 679#endif
This page took 0.62244 seconds and 4 git commands to generate.