1 | $OpenBSD$ |
---|
2 | |
---|
3 | Prevent error from gcc 6: |
---|
4 | HashSet.h:191:32: error: could not convert ... |
---|
5 | from 'std::pair<WTF::HashTableIterator<...>, bool>' |
---|
6 | to 'std::pair<WTF::HashTableConstIteratorAdapter<...>, bool>' |
---|
7 | |
---|
8 | gcc 6 accepts 'pair<iterator, bool>(p.first, p.second)' but gcc 8 |
---|
9 | needs 'iterator(p.first)' to convert the iterator. |
---|
10 | |
---|
11 | The iterator_const_cast for MSVC doesn't work in gcc 6. |
---|
12 | |
---|
13 | Index: src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h |
---|
14 | --- src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h.orig |
---|
15 | +++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h |
---|
16 | @@ -188,7 +188,8 @@ namespace WTF { |
---|
17 | #if COMPILER(MSVC) && _MSC_VER >= 1700 |
---|
18 | return iterator_const_cast(m_impl.add(value)); |
---|
19 | #else |
---|
20 | - return m_impl.add(value); |
---|
21 | + pair<typename HashTableType::iterator, bool> p = m_impl.add(value); |
---|
22 | + return pair<iterator, bool>(iterator(p.first), p.second); |
---|
23 | #endif |
---|
24 | } |
---|
25 | |
---|
26 | @@ -201,7 +202,9 @@ namespace WTF { |
---|
27 | #if COMPILER(MSVC) && _MSC_VER >= 1700 |
---|
28 | return iterator_const_cast(m_impl.template addPassingHashCode<T, T, Adapter>(value, value)); |
---|
29 | #else |
---|
30 | - return m_impl.template addPassingHashCode<T, T, Adapter>(value, value); |
---|
31 | + pair<typename HashTableType::iterator, bool> p = |
---|
32 | + m_impl.template addPassingHashCode<T, T, Adapter>(value, value); |
---|
33 | + return pair<iterator, bool>(iterator(p.first), p.second); |
---|
34 | #endif |
---|
35 | } |
---|
36 | |
---|