From ba851346b59e5c079a9fc34f3963231c4aa6ee87 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 Sep 2015 03:39:17 +0200 Subject: [PATCH] Try to work around VC8 compiler bug after ZIP64 changes Add an explicit cast to ensure that both branches of the ternary operator have the same type. --- src/common/zipstrm.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index 391cb92334..c99da77d51 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -1060,8 +1060,11 @@ size_t wxZipEntry::ReadLocal(wxInputStream& stream, wxMBConv& conv) if ((sumsValid || size) || m_Method == wxZIP_METHOD_STORE) m_Size = size; - wxMBConv& strConv = - ( (m_Flags & wxZIP_LANG_ENC_UTF8) == 0 ) ? conv : wxConvUTF8; + // Explicit cast to the base class is needed to work around apparent + // compiler bug in MSVS 2005 (FIXME-VC8). + wxMBConv& strConv = m_Flags & wxZIP_LANG_ENC_UTF8 + ? static_cast(wxConvUTF8) + : conv; SetName(ReadString(stream, nameLen, strConv), wxPATH_UNIX); if (stream.LastRead() != nameLen + 0u) return 0;