/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
Copyright (C) 2006-2010 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Bruno Haible and Paul Eggert. */
/*
* ISO C 99 <wctype.h> for platforms that lack it.
*
* iswctype, towctrans, towlower, towupper, wctrans, wctype,
* wctrans_t, and wctype_t are not yet implemented.
*/
#ifndef _GL_WCTYPE_H
#if __GNUC__ >= 3
#endif
#if @HAVE_WINT_T@
Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
included before <wchar.h>. */
# include <stddef.h>
# include <stdio.h>
# include <time.h>
# include <wchar.h>
#endif
/* Include the original <wctype.h> if it exists.
BeOS 5 has the functions but no <wctype.h>. */
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_WCTYPE_H@
# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
#endif
#ifndef _GL_WCTYPE_H
#define _GL_WCTYPE_H
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
/* Define wint_t and WEOF. (Also done in wchar.in.h.) */
#if !@HAVE_WINT_T@ && !defined wint_t
# define wint_t int
# ifndef WEOF
# endif
#else
# ifndef WEOF
# endif
#endif
/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
Linux libc5 has <wctype.h> and the functions but they are broken.
Assume all 11 functions (all isw* except iswblank) are implemented the
same way, or not at all. */
#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
refer to system functions like _iswctype that are not in the
standard C library. Rather than try to get ancient buggy
implementations like this to work, just disable them. */
/* Linux libc5 has <wctype.h> and the functions but they are broken. */
# if @REPLACE_ISWCNTRL@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif
# endif
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline int
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline wint_t
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
static inline wint_t
# if @REPLACE_ISWCNTRL@
# else
# endif
{
}
/* Only the iswblank function is missing. */
# if @REPLACE_ISWBLANK@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define iswblank rpl_iswblank
# endif
# endif
static inline int
# if @REPLACE_ISWBLANK@
# else
# endif
{
}
#endif
#if defined __MINGW32__
/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
The functions towlower and towupper are implemented in the MSVCRT library
to take a wchar_t argument and return a wchar_t result. mingw declares
these functions to take a wint_t argument and return a wint_t result.
This means that:
1. When the user passes an argument outside the range 0x0000..0xFFFF, the
function will look only at the lower 16 bits. This is allowed according
to POSIX.
2. The return value is returned in the lower 16 bits of the result register.
The upper 16 bits are random: whatever happened to be in that part of the
result register. We need to fix this by adding a zero-extend from
wchar_t to wint_t after the call. */
static inline wint_t
{
}
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif
static inline wint_t
{
}
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif
#endif /* __MINGW32__ */
#if @REPLACE_ISWCNTRL@
#else
# if @REPLACE_ISWBLANK@
# else
# endif
#endif
#if @REPLACE_ISWCNTRL@ || defined __MINGW32__
#else
#endif
#endif /* _GL_WCTYPE_H */
#endif /* _GL_WCTYPE_H */