about summary refs log tree commit diff
path: root/iconv
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-07-28 19:02:07 +0000
committerUlrich Drepper <drepper@redhat.com>2007-07-28 19:02:07 +0000
commit7b503bcc1373670a4456ba8f4a5ccfce712347d1 (patch)
treede7baba18c2438fc91a770581f7c44edaab5ed7a /iconv
parenta95a608f1b07a5c6e562294c570e89645d9b6176 (diff)
downloadglibc-7b503bcc1373670a4456ba8f4a5ccfce712347d1.tar.gz
glibc-7b503bcc1373670a4456ba8f4a5ccfce712347d1.tar.xz
glibc-7b503bcc1373670a4456ba8f4a5ccfce712347d1.zip
* 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  <jakub@redhat.com>

	* 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.
Diffstat (limited to 'iconv')
-rw-r--r--iconv/gconv.h3
-rw-r--r--iconv/gconv_cache.c4
-rw-r--r--iconv/gconv_db.c5
-rw-r--r--iconv/gconv_int.h8
4 files changed, 14 insertions, 6 deletions
diff --git a/iconv/gconv.h b/iconv/gconv.h
index d8be8fa8cf..2946335e5e 100644
--- a/iconv/gconv.h
+++ b/iconv/gconv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-1999, 2000-2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997-1999, 2000-2002, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
 
 #include <features.h>
 #define __need_mbstate_t
+#define __need_wint_t
 #include <wchar.h>
 #define __need_size_t
 #define __need_wchar_t
diff --git a/iconv/gconv_cache.c b/iconv/gconv_cache.c
index 716c384de2..4fcb0bc2b4 100644
--- a/iconv/gconv_cache.c
+++ b/iconv/gconv_cache.c
@@ -1,5 +1,5 @@
 /* Cache handling for iconv modules.
-   Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 2001.
 
@@ -285,7 +285,7 @@ __gconv_lookup_cache (const char *toset, const char *fromset,
 
   /* Avoid copy-only transformations if the user requests.   */
   if (__builtin_expect (flags & GCONV_AVOID_NOCONV, 0) && fromidx == toidx)
-    return __GCONV_NOCONV;
+    return __GCONV_NULCONV;
 
   /* If there are special conversions available examine them first.  */
   if (fromidx != 0 && toidx != 0
diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c
index 6540cc393c..cf452e786a 100644
--- a/iconv/gconv_db.c
+++ b/iconv/gconv_db.c
@@ -1,5 +1,6 @@
 /* Provide access to the collection of available transformation modules.
-   Copyright (C) 1997-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997-2003, 2004, 2005, 2006, 2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -756,7 +757,7 @@ __gconv_find_transform (const char *toset, const char *fromset,
     {
       /* Both character sets are the same.  */
       __libc_lock_unlock (__gconv_lock);
-      return __GCONV_NOCONV;
+      return __GCONV_NULCONV;
     }
 
   result = find_derivation (toset, toset_expand, fromset, fromset_expand,
diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h
index 8d9cdaefc2..fd112204bc 100644
--- a/iconv/gconv_int.h
+++ b/iconv/gconv_int.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -114,6 +114,12 @@ enum
   GCONV_AVOID_NOCONV = 1 << 0
 };
 
+/* When GCONV_AVOID_NOCONV is set and no conversion is needed,
+   __GCONV_NULCONV should be returned.  */
+enum
+{
+  __GCONV_NULCONV = -1
+};
 
 /* Global variables.  */