Remove Mac specific code paths from qiconvcodec
The code is dead, as the codec is never used on macOS. Change-Id: I86138f1c95e5564256b4d592f0044e83658def93 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
fd9e5d9033
commit
5d9413ab35
@ -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<QTextCodec *>(~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<Ptr_iconv_open>(libiconv.resolve("libiconv_open"));
|
||||
if (!ptr_iconv_open)
|
||||
ptr_iconv_open = reinterpret_cast<Ptr_iconv_open>(libiconv.resolve("iconv_open"));
|
||||
ptr_iconv = reinterpret_cast<Ptr_iconv>(libiconv.resolve("libiconv"));
|
||||
if (!ptr_iconv)
|
||||
ptr_iconv = reinterpret_cast<Ptr_iconv>(libiconv.resolve("iconv"));
|
||||
ptr_iconv_close = reinterpret_cast<Ptr_iconv_close>(libiconv.resolve("libiconv_close"));
|
||||
if (!ptr_iconv_close)
|
||||
ptr_iconv_close = reinterpret_cast<Ptr_iconv_close>(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()
|
||||
|
@ -56,11 +56,7 @@
|
||||
|
||||
QT_REQUIRE_CONFIG(iconv);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
typedef void * iconv_t;
|
||||
#else
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user