Allow building with upcoming libiconv 1.12. No code changes with earlier

libiconv versions.
ok landry@ and qt4 ok espie@
This commit is contained in:
naddy 2008-05-26 17:08:35 +00:00
parent ba24d38327
commit aaf788fc9c
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_portable_cpp,v 1.1 2008/05/26 17:08:35 naddy Exp $
--- src/portable.cpp.orig Sat May 24 22:08:47 2008
+++ src/portable.cpp Sat May 24 22:10:27 2008
@@ -377,7 +377,7 @@ void * portable_iconv_open(const char* tocode, const c
size_t portable_iconv (void *cd, const char** inbuf, size_t *inbytesleft,
char** outbuf, size_t *outbytesleft)
{
-#if ((defined(_LIBICONV_VERSION) && (_LIBICONV_VERSION>=0x0109)) || defined(_OS_SOLARIS_))
+#if ((defined(_LIBICONV_VERSION) && (_LIBICONV_VERSION>=0x0109 && _LIBICONV_VERSION<0x010B)) || defined(_OS_SOLARIS_))
#define CASTNEEDED(x) (x)
#else
#define CASTNEEDED(x) (char **)(x)

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-config_tests_unix_gnu-libiconv_gnu-libiconv_cpp,v 1.1 2008/05/26 17:08:35 naddy Exp $
--- config.tests/unix/gnu-libiconv/gnu-libiconv.cpp.orig Sun May 25 17:42:09 2008
+++ config.tests/unix/gnu-libiconv/gnu-libiconv.cpp Sun May 25 17:43:31 2008
@@ -7,7 +7,11 @@ int main(int, char **)
{
iconv_t x = iconv_open("", "");
+#if _LIBICONV_VERSION < 0x010B
const char *inp;
+#else
+ char *inp;
+#endif
char *outp;
size_t inbytes, outbytes;
iconv(x, &inp, &inbytes, &outp, &outbytes);

View File

@ -0,0 +1,39 @@
$OpenBSD: patch-src_corelib_codecs_qiconvcodec_cpp,v 1.1 2008/05/26 17:08:35 naddy Exp $
--- src/corelib/codecs/qiconvcodec.cpp.orig Sun May 25 19:00:35 2008
+++ src/corelib/codecs/qiconvcodec.cpp Sun May 25 19:03:40 2008
@@ -136,7 +136,7 @@ QString QIconvCodec::convertToUnicode(const char* char
QByteArray ba;
size_t outBytesLeft = len * 2 + 2;
ba.resize(outBytesLeft);
-#ifdef GNU_LIBICONV
+#if defined(GNU_LIBICONV) && (_LIBICONV_VERSION < 0x010B)
// GNU doesn't disagree with POSIX :/
const char *inBytes = chars;
#else
@@ -196,7 +196,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar
ba.resize(outBytesLeft);
char *outBytes = ba.data();
-#if defined(GNU_LIBICONV)
+#if defined(GNU_LIBICONV) && (_LIBICONV_VERSION < 0x010B)
const char *inBytes;
#else
char *inBytes;
@@ -206,7 +206,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar
#if !defined(NO_BOM)
// give iconv() a BOM
QChar bom[] = { QChar(QChar::ByteOrderMark) };
-#ifdef GNU_LIBICONV
+#if defined(GNU_LIBICONV) && (_LIBICONV_VERSION < 0x010B)
// GNU doesn't disagree with POSIX :/
inBytes = reinterpret_cast<const char *>(bom);
#else
@@ -220,7 +220,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar
#endif // NO_BOM
// now feed iconv() the real data
-#ifdef GNU_LIBICONV
+#if defined(GNU_LIBICONV) && (_LIBICONV_VERSION < 0x010B)
// GNU doesn't disagree with POSIX :/
inBytes = reinterpret_cast<const char *>(uc);
#else