From 5d9413ab3574dd65fb9380bed88caa22d3e5dc92 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 22 Nov 2016 10:14:07 +0100 Subject: [PATCH] Remove Mac specific code paths from qiconvcodec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code is dead, as the codec is never used on macOS. Change-Id: I86138f1c95e5564256b4d592f0044e83658def93 Reviewed-by: Morten Johan Sørvig Reviewed-by: Oswald Buddenhagen --- src/corelib/codecs/qiconvcodec.cpp | 42 +----------------------------- src/corelib/codecs/qiconvcodec_p.h | 4 --- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp index 8961d01eee..e4fb359f2c 100644 --- a/src/corelib/codecs/qiconvcodec.cpp +++ b/src/corelib/codecs/qiconvcodec.cpp @@ -64,7 +64,7 @@ QT_REQUIRE_CONFIG(iconv); #elif defined(Q_OS_AIX) # define NO_BOM # define UTF16 "UCS-2" -#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) +#elif defined(Q_OS_FREEBSD) # define NO_BOM # if Q_BYTE_ORDER == Q_BIG_ENDIAN # define UTF16 "UTF-16BE" @@ -75,19 +75,6 @@ QT_REQUIRE_CONFIG(iconv); # define UTF16 "UTF-16" #endif -#if defined(Q_OS_MAC) -#ifndef GNU_LIBICONV -#define GNU_LIBICONV -#endif -typedef iconv_t (*Ptr_iconv_open) (const char*, const char*); -typedef size_t (*Ptr_iconv) (iconv_t, const char **, size_t *, char **, size_t *); -typedef int (*Ptr_iconv_close) (iconv_t); - -static Ptr_iconv_open ptr_iconv_open = 0; -static Ptr_iconv ptr_iconv = 0; -static Ptr_iconv_close ptr_iconv_close = 0; -#endif - QT_BEGIN_NAMESPACE QIconvCodec::QIconvCodec() @@ -105,33 +92,6 @@ void QIconvCodec::init() const fprintf(stderr, "QIconvCodec::convertToUnicode: internal error, UTF-16 codec not found\n"); utf16Codec = reinterpret_cast(~0); } -#if defined(Q_OS_MAC) - if (ptr_iconv_open == 0) { - QLibrary libiconv(QLatin1String("/usr/lib/libiconv")); - libiconv.setLoadHints(QLibrary::ExportExternalSymbolsHint); - - ptr_iconv_open = reinterpret_cast(libiconv.resolve("libiconv_open")); - if (!ptr_iconv_open) - ptr_iconv_open = reinterpret_cast(libiconv.resolve("iconv_open")); - ptr_iconv = reinterpret_cast(libiconv.resolve("libiconv")); - if (!ptr_iconv) - ptr_iconv = reinterpret_cast(libiconv.resolve("iconv")); - ptr_iconv_close = reinterpret_cast(libiconv.resolve("libiconv_close")); - if (!ptr_iconv_close) - ptr_iconv_close = reinterpret_cast(libiconv.resolve("iconv_close")); - - Q_ASSERT_X(ptr_iconv_open && ptr_iconv && ptr_iconv_close, - "QIconvCodec::QIconvCodec()", - "internal error, could not resolve the iconv functions"); - -# undef iconv_open -# define iconv_open ptr_iconv_open -# undef iconv -# define iconv ptr_iconv -# undef iconv_close -# define iconv_close ptr_iconv_close - } -#endif } QIconvCodec::~QIconvCodec() diff --git a/src/corelib/codecs/qiconvcodec_p.h b/src/corelib/codecs/qiconvcodec_p.h index d99e72f635..9b8500538b 100644 --- a/src/corelib/codecs/qiconvcodec_p.h +++ b/src/corelib/codecs/qiconvcodec_p.h @@ -56,11 +56,7 @@ QT_REQUIRE_CONFIG(iconv); -#ifdef Q_OS_MAC -typedef void * iconv_t; -#else #include -#endif QT_BEGIN_NAMESPACE