From 7b503bcc1373670a4456ba8f4a5ccfce712347d1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 28 Jul 2007 19:02:07 +0000 Subject: * iconv/gconv_int.h (__GCONV_NULCONV): New internal only error code. * iconv/gconv_cache.c (__gconv_lookup_cache): Return __GCONV_NULCONV if from and to charsets are the same. * iconv/gconv_db.c (__gconv_find_transform): Likewise. * intl/dcigettext.c (_nl_find_msg): Return NULL even if __gconv_open returns __GCONV_NOCONV, but not for __GCONV_NULCONV. 2007-07-17 Jakub Jelinek * wcsmbs/wchar.h: Only define wint_t if __need_wint_t. Don't define wint_t when __need_mbstate_t unless it is necessary. (__mbstate_t): Use __WINT_TYPE__ rather than wint_t in the typedef if possible. * wctype/wctype.h (wint_t): Define by including wchar.h with __need_wint_t instead of including stddef.h with __need_wint_t and as fallback definining it ourselves. * iconv/gconv.h (__need_wint_t): Define before including wchar.h. * sysdeps/gnu/_G_config.h: Don't include gconv.h if not _LIBC or _GLIBCPP_USE_WCHAR_T. (__need_wchar_t): Don't define if not _LIBC or _GLIBCPP_USE_WCHAR_T. (__need_wint_t): Don't define before including stddef.h, define before including wchar.h only if _LIBC or _GLIBCPP_USE_WCHAR_T. (_G_iconv_t): Don't define if not _LIBC or _GLIBCPP_USE_WCHAR_T. * sysdeps/mach/hurd/_G_config.h: Likewise. * sysdeps/generic/_G_config.h: Likewise. * libio/libio.h (__wunderflow, __wuflow, __woverflow): Only prototype if _LIBC or _GLIBCPP_USE_WCHAR_T. (_IO_getwc_unlocked, _IO_putwc_unlocked): Only define if _LIBC or _GLIBCPP_USE_WCHAR_T. --- wcsmbs/wchar.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'wcsmbs/wchar.h') diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index e9a3fba..569fd2b 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -23,7 +23,7 @@ #ifndef _WCHAR_H -#ifndef __need_mbstate_t +#if !defined __need_mbstate_t && !defined __need_wint_t # define _WCHAR_H 1 # include #endif @@ -39,38 +39,40 @@ # define __need___va_list # include +# include + /* Get size_t, wchar_t, wint_t and NULL from . */ # define __need_size_t # define __need_wchar_t # define __need_NULL #endif -#define __need_wint_t -#include - -#include +#if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__ +# undef __need_wint_t +# define __need_wint_t +# include /* We try to get wint_t from , but not all GCC versions define it there. So define it ourselves if it remains undefined. */ -#ifndef _WINT_T +# ifndef _WINT_T /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ -# define _WINT_T +# define _WINT_T typedef unsigned int wint_t; -#else +# else /* Work around problems with the file which doesn't put wint_t in the std namespace. */ -# if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ - && defined __WINT_TYPE__ +# if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ + && defined __WINT_TYPE__ __BEGIN_NAMESPACE_STD typedef __WINT_TYPE__ wint_t; __END_NAMESPACE_STD +# endif # endif #endif - -#ifndef __mbstate_t_defined +#if (defined _WCHAR_H || defined __need_mbstate_t) && !defined __mbstate_t_defined # define __mbstate_t_defined 1 /* Conversion state information. */ typedef struct @@ -78,7 +80,11 @@ typedef struct int __count; union { +# ifdef __WINT_TYPE__ + __WINT_TYPE__ __wch; +# else wint_t __wch; +# endif char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; -- cgit v1.1