wctype.in.h revision 2
2N/A/* A substitute for ISO C99 <wctype.h>, for platforms that lack it. 2N/A Copyright (C) 2006-2010 Free Software Foundation, Inc. 2N/A This program is free software; you can redistribute it and/or modify 2N/A it under the terms of the GNU General Public License as published by 2N/A the Free Software Foundation; either version 3, or (at your option) 2N/A This program is distributed in the hope that it will be useful, 2N/A but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A GNU General Public License for more details. 2N/A You should have received a copy of the GNU General Public License 2N/A along with this program; if not, write to the Free Software Foundation, 2N/A Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 2N/A/* Written by Bruno Haible and Paul Eggert. */ 2N/A * iswctype, towctrans, towlower, towupper, wctrans, wctype, 2N/A * wctrans_t, and wctype_t are not yet implemented. 2N/A Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before 2N/A/* The include_next requires a split double-inclusion guard. */ 2N/A/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 2N/A/* The definition of _GL_WARN_ON_USE is copied here. */ 2N/A/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions. 2N/A Linux libc5 has <wctype.h> and the functions but they are broken. 2N/A Assume all 11 functions (all isw* except iswblank) are implemented the 2N/A same way, or not at all. */ 2N/A/* IRIX 5.3 has macros but no functions, its isw* macros refer to an 2N/A undefined variable _ctmp_ and to <ctype.h> macros like _P, and they 2N/A refer to system functions like _iswctype that are not in the 2N/A standard C library. Rather than try to get ancient buggy 2N/A implementations like this to work, just disable them. */ 2N/A/* Linux libc5 has <wctype.h> and the functions but they are broken. */ 2N/A || ((
wc & ~
0x20) >=
'A' && (
wc & ~
0x20) <=
'Z'));
2N/A return (
wc & ~
0x20) >=
'A' && (
wc & ~
0x20) <=
'Z';
2N/A return (
wc & ~
0x1f) == 0 ||
wc ==
0x7f;
2N/A || ((
wc & ~
0x20) >=
'A' && (
wc & ~
0x20) <=
'Z')));
2N/A ||
wc ==
'\n' ||
wc ==
'\v' ||
wc ==
'\f' ||
wc ==
'\r');
2N/A || ((
wc & ~
0x20) >=
'A' && (
wc & ~
0x20) <=
'F'));
2N/A/* Only the iswblank function is missing. */ 2N/A/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t. 2N/A The functions towlower and towupper are implemented in the MSVCRT library 2N/A to take a wchar_t argument and return a wchar_t result. mingw declares 2N/A these functions to take a wint_t argument and return a wint_t result. 2N/A 1. When the user passes an argument outside the range 0x0000..0xFFFF, the 2N/A function will look only at the lower 16 bits. This is allowed according 2N/A 2. The return value is returned in the lower 16 bits of the result register. 2N/A The upper 16 bits are random: whatever happened to be in that part of the 2N/A result register. We need to fix this by adding a zero-extend from 2N/A wchar_t to wint_t after the call. */ 2N/A#
endif /* __MINGW32__ */ 2N/A#
endif /* _GL_WCTYPE_H */ 2N/A#
endif /* _GL_WCTYPE_H */