summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorAshish Kulkarni <kulkarni.ashish@gmail.com>2014-04-12 16:59:14 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-17 18:29:02 (GMT)
commit1bed55097b22f2071af71ebefc9897816977fd14 (patch)
tree0b64566fd328119df0bd1f7e4e8134d5d89e31aa /src/3rdparty
parent3d5122eab127fbe13d4e13a92ee5f6d6686d2f2f (diff)
downloadQt-1bed55097b22f2071af71ebefc9897816977fd14.zip
Qt-1bed55097b22f2071af71ebefc9897816977fd14.tar.gz
Qt-1bed55097b22f2071af71ebefc9897816977fd14.tar.bz2
Fix compilation of QtWebKit with MSVC 2012/2013
For some reason, MSVC 2012/2013 is no longer able to infer the need for both a call to a constructor and a cast of its parameter so we have to give a hint for at least one of these two operations. Task-number: QTBUG-31882 Change-Id: I42b54313ec4f6a83cde28326534c59b93ab3f615 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
index 82245f3..52b9f22 100644
--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
+++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
@@ -92,6 +92,14 @@ namespace WTF {
friend void deleteAllValues<>(const HashSet&);
friend void fastDeleteAllValues<>(const HashSet&);
+#if COMPILER(MSVC) && _MSC_VER >= 1700
+ // MSVC2012/MSVC2013 has trouble constructing a HashTableConstIteratorAdapter from a
+ // HashTableIterator despite the existence of a const_iterator cast method on the latter class.
+ pair<iterator, bool> iterator_const_cast(const pair<typename HashTableType::iterator, bool>& p)
+ {
+ return make_pair(iterator(HashTableType::const_iterator(p.first)), p.second);
+ }
+#endif
HashTableType m_impl;
};
@@ -177,7 +185,11 @@ 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)
{
+#if COMPILER(MSVC) && _MSC_VER >= 1700
+ return iterator_const_cast(m_impl.add(value));
+#else
return m_impl.add(value);
+#endif
}
template<typename Value, typename HashFunctions, typename Traits>
@@ -186,7 +198,11 @@ namespace WTF {
HashSet<Value, HashFunctions, Traits>::add(const T& value)
{
typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
+#if COMPILER(MSVC) && _MSC_VER >= 1700
+ return iterator_const_cast(m_impl.template addPassingHashCode<T, T, Adapter>(value, value));
+#else
return m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
+#endif
}
template<typename T, typename U, typename V>