aboutsummaryrefslogtreecommitdiff
path: root/devel/qt4-corelib/files/patch-src_corelib_codecs_qiconvcodec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'devel/qt4-corelib/files/patch-src_corelib_codecs_qiconvcodec.cpp')
-rw-r--r--devel/qt4-corelib/files/patch-src_corelib_codecs_qiconvcodec.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/devel/qt4-corelib/files/patch-src_corelib_codecs_qiconvcodec.cpp b/devel/qt4-corelib/files/patch-src_corelib_codecs_qiconvcodec.cpp
new file mode 100644
index 000000000000..6a7c231eef99
--- /dev/null
+++ b/devel/qt4-corelib/files/patch-src_corelib_codecs_qiconvcodec.cpp
@@ -0,0 +1,39 @@
+--- src/corelib/codecs/qiconvcodec.cpp.orig 2014-04-10 18:37:11 UTC
++++ src/corelib/codecs/qiconvcodec.cpp
+@@ -219,12 +219,7 @@ QString QIconvCodec::convertToUnicode(co
+ IconvState *state = *pstate;
+ size_t inBytesLeft = len;
+ // best case assumption, each byte is converted into one UTF-16 character, plus 2 bytes for the BOM
+-#ifdef GNU_LIBICONV
+- // GNU doesn't disagree with POSIX :/
+- const char *inBytes = chars;
+-#else
+ char *inBytes = const_cast<char *>(chars);
+-#endif
+
+ QByteArray in;
+ if (remainingCount) {
+@@ -318,11 +313,7 @@ static bool setByteOrder(iconv_t cd)
+ size_t outBytesLeft = sizeof buf;
+ size_t inBytesLeft = sizeof bom;
+
+-#if defined(GNU_LIBICONV)
+- const char **inBytesPtr = const_cast<const char **>(&inBytes);
+-#else
+ char **inBytesPtr = &inBytes;
+-#endif
+
+ if (iconv(cd, inBytesPtr, &inBytesLeft, &outBytes, &outBytesLeft) == (size_t) -1) {
+ return false;
+@@ -338,11 +329,7 @@ QByteArray QIconvCodec::convertFromUnico
+ char *outBytes;
+ size_t inBytesLeft;
+
+-#if defined(GNU_LIBICONV)
+- const char **inBytesPtr = const_cast<const char **>(&inBytes);
+-#else
+ char **inBytesPtr = &inBytes;
+-#endif
+
+ IconvState *temporaryState = 0;
+ QThreadStorage<QIconvCodec::IconvState *> *ts = fromUnicodeState();