Skip to content

Making Qt 4.8.6 compile with Visual Studio 2013

François Beaune edited this page Jun 9, 2018 · 4 revisions

This patch was inspired by this Qt ticket.

Download the patch and apply it with patch -p0 < qt-486.patch.

Content of the patch:

--- mkspecs/win32-msvc2013/qmake.conf
+++ mkspecs/win32-msvc2013/qmake.conf
@@ -57,8 +57,8 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CX
 QMAKE_LINK              = link
 QMAKE_LFLAGS            = /NOLOGO /DYNAMICBASE /NXCOMPAT
 QMAKE_LFLAGS_RELEASE    = /INCREMENTAL:NO
-QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
-QMAKE_LFLAGS_DEBUG      = /DEBUG
+QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
+QMAKE_LFLAGS_DEBUG      = /DEBUG /INCREMENTAL:NO
 QMAKE_LFLAGS_CONSOLE    = /SUBSYSTEM:CONSOLE
 QMAKE_LFLAGS_WINDOWS    = /SUBSYSTEM:WINDOWS
 QMAKE_LFLAGS_EXE        = \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\"
--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
+++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
@@ -177,7 +177,9 @@ namespace WTF {
     template<typename T, typename U, typename V>
     inline pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value)
     {
-        return m_impl.add(value);
+        typedef typename HashSet<T, U, V>::iterator iter_type;
+        auto& p = m_impl.add(value);
+        return make_pair((iter_type)p.first, p.second);
     }
 
     template<typename Value, typename HashFunctions, typename Traits>
@@ -186,7 +188,9 @@ namespace WTF {
     HashSet<Value, HashFunctions, Traits>::add(const T& value)
     {
         typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
-        return m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
+        typedef typename HashSet<Value, HashFunctions, Traits>::iterator iter_type;
+        auto& p = m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
+        return make_pair((iter_type)p.first, p.second);
     }
 
     template<typename T, typename U, typename V>
--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/MathExtras.h
+++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/MathExtras.h
@@ -110,7 +110,7 @@ inline bool signbit(double x) { struct i
 
 #endif
 
-#if COMPILER(MSVC) || (COMPILER(RVCT) && !(RVCT_VERSION_AT_LEAST(3, 0, 0, 0)))
+#if (COMPILER(MSVC) && _MSC_VER < 1800) || (COMPILER(RVCT) && !(RVCT_VERSION_AT_LEAST(3, 0, 0, 0)))
 
 // We must not do 'num + 0.5' or 'num - 0.5' because they can cause precision loss.
 static double round(double num)
@@ -135,7 +135,7 @@ inline double trunc(double num) { return
 
 #endif
 
-#if COMPILER(MSVC)
+#if COMPILER(MSVC) && _MSC_VER < 1800
 // The 64bit version of abs() is already defined in stdlib.h which comes with VC10
 #if COMPILER(MSVC9_OR_LOWER)
 inline long long abs(long long num) { return _abs64(num); }
Clone this wiki locally