aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-01-29 18:34:14 +0100
committerBruno Haible <bruno@clisp.org>2011-01-29 18:34:14 +0100
commit3cdff14a3cc549dc4ccfe02dca46e73b1e7a68c6 (patch)
treebeed40b1606f303012985e63646f76bafe013877
parentc38bdb4f3b9fea339bafd44a3723522c90b42fcb (diff)
downloadandroid-libiconv-3cdff14a3cc549dc4ccfe02dca46e73b1e7a68c6.tar.gz
android-libiconv-3cdff14a3cc549dc4ccfe02dca46e73b1e7a68c6.tar.bz2
android-libiconv-3cdff14a3cc549dc4ccfe02dca46e73b1e7a68c6.zip
Simplify "wchar_t" handling on Cygwin 1.7.x.
-rw-r--r--ChangeLog9
-rw-r--r--lib/iconv.c10
-rw-r--r--lib/iconv_open1.h12
3 files changed, 22 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index df81fd3..3d867c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-01-29 Corinna Vinschen <corinna-cygwin@cygwin.com>
+ Bruno Haible <bruno@clisp.org>
+
+ Simplify "wchar_t" handling on Cygwin 1.7.x.
+ * lib/iconv.c (iconv_canonicalize): On Cygwin >= 1.7, map
+ ei_local_wchar_t to ei_utf16le or ei_utf16be, not ei_ucs2internal.
+ * lib/iconv_open1.h: Likewise.
+ Rationale: <http://cygwin.com/ml/cygwin/2011-01/msg00410.html>.
+
2011-01-29 Bruno Haible <bruno@clisp.org>
Adjust the meaning of "wchar_t" on native Windows systems.
diff --git a/lib/iconv.c b/lib/iconv.c
index 977e771..3785296 100644
--- a/lib/iconv.c
+++ b/lib/iconv.c
@@ -25,6 +25,10 @@
#include "config.h"
#include "localcharset.h"
+#ifdef __CYGWIN__
+#include <cygwin/version.h>
+#endif
+
#if ENABLE_EXTRA
/*
* Consider all system dependent encodings, for any system,
@@ -549,9 +553,9 @@ const char * iconv_canonicalize (const char * name)
}
if (ap->encoding_index == ei_local_wchar_t) {
/* On systems which define __STDC_ISO_10646__, wchar_t is Unicode.
- This is also the case on native Woe32 systems, where we know that it
- is UTF-16. */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ This is also the case on native Woe32 systems and Cygwin >= 1.7, where
+ we know that it is UTF-16. */
+#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || (defined __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR >= 1007)
if (sizeof(wchar_t) == 4) {
index = ei_ucs4internal;
break;
diff --git a/lib/iconv_open1.h b/lib/iconv_open1.h
index ce1a576..acee5a4 100644
--- a/lib/iconv_open1.h
+++ b/lib/iconv_open1.h
@@ -97,9 +97,9 @@
}
if (ap->encoding_index == ei_local_wchar_t) {
/* On systems which define __STDC_ISO_10646__, wchar_t is Unicode.
- This is also the case on native Woe32 systems, where we know that it
- is UTF-16. */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ This is also the case on native Woe32 systems and Cygwin >= 1.7, where
+ we know that it is UTF-16. */
+#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || (defined __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR >= 1007)
if (sizeof(wchar_t) == 4) {
to_index = ei_ucs4internal;
break;
@@ -187,9 +187,9 @@
}
if (ap->encoding_index == ei_local_wchar_t) {
/* On systems which define __STDC_ISO_10646__, wchar_t is Unicode.
- This is also the case on native Woe32 systems, where we know that it
- is UTF-16. */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ This is also the case on native Woe32 systems and Cygwin >= 1.7, where
+ we know that it is UTF-16. */
+#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || (defined __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR >= 1007)
if (sizeof(wchar_t) == 4) {
from_index = ei_ucs4internal;
break;