summaryrefslogtreecommitdiff
path: root/x11/qt4-libs
diff options
context:
space:
mode:
authorjoerg <joerg>2013-05-09 14:07:08 +0000
committerjoerg <joerg>2013-05-09 14:07:08 +0000
commitced37eb1b894f6b22e1a93387251b8b646ae5f34 (patch)
tree1963decac357108da745e9eccfdc18f351259205 /x11/qt4-libs
parent3d801397e6c0d5faa4f0bc09ad0d1aea3f935d57 (diff)
downloadpkgsrc-ced37eb1b894f6b22e1a93387251b8b646ae5f34.tar.gz
Don't use forward defines for the std namespace. Fix various
inconsistencies in the iterator usage. Explicitly specify which wcschr variant to use. Allow building with libc++ and use <atomic> in that case.
Diffstat (limited to 'x11/qt4-libs')
-rw-r--r--x11/qt4-libs/Makefile7
-rw-r--r--x11/qt4-libs/distinfo24
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_clucene_src_CLucene_config_repl__tchar.h13
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.cpp18
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.h17
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_HashTable.h13
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_RefCountedLeakCounter.h13
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_Threading.h29
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.cpp37
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.h12
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_parser_JSParser.cpp15
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Atomics.h44
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_HashSet.h104
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_NullPtr.h13
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_RefCountedLeakCounter.h13
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_ThreadSafeRefCounted.h22
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h6
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.cpp248
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.h18
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_network_qt_QNetworkReplyHandler.cpp73
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebKit_qt_Api_qgraphicswebview.cpp22
-rw-r--r--x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebKit_qt_WebCoreSupport_NotificationPresenterClientQt.cpp28
-rw-r--r--x11/qt4-libs/patches/patch-src_corelib_tools_qiterator.h16
23 files changed, 799 insertions, 6 deletions
diff --git a/x11/qt4-libs/Makefile b/x11/qt4-libs/Makefile
index 1075f2f52b1..9ee1741d5ca 100644
--- a/x11/qt4-libs/Makefile
+++ b/x11/qt4-libs/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.87 2013/04/13 10:29:26 jaapb Exp $
+# $NetBSD: Makefile,v 1.88 2013/05/09 14:07:08 joerg Exp $
PKGNAME= qt4-libs-${QTVERSION}
PKGREVISION= 4
@@ -26,6 +26,11 @@ CONFIGURE_ARGS+= -no-sql-sqlite
# kdelibs4 requires openssl support!
CONFIGURE_ARGS+= -openssl-linked
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+CXXFLAGS+= -std=c++11 -Wno-c++11-narrowing
+.endif
+
INSTALLATION_DIRS= lib/pkgconfig
INSTALLATION_DIRS+= ${QTPREFIX}/bin
INSTALLATION_DIRS+= ${QTPREFIX}/imports/Qt/labs/folderlistmodel
diff --git a/x11/qt4-libs/distinfo b/x11/qt4-libs/distinfo
index 450fdb0baba..29b2fc03885 100644
--- a/x11/qt4-libs/distinfo
+++ b/x11/qt4-libs/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.84 2013/04/13 10:29:26 jaapb Exp $
+$NetBSD: distinfo,v 1.85 2013/05/09 14:07:08 joerg Exp $
SHA1 (qt-everywhere-opensource-src-4.8.4.tar.gz) = f5880f11c139d7d8d01ecb8d874535f7d9553198
RMD160 (qt-everywhere-opensource-src-4.8.4.tar.gz) = 3c09a3b1411385d0917225f01ac2ff3a2ce83fda
@@ -38,22 +38,42 @@ SHA1 (patch-cb) = 13e1b0ffb171637e1ff84a548ef83cf4e006c207
SHA1 (patch-cg) = 2519fe525237167f10dffb9294c861f4d7063f31
SHA1 (patch-qmake_generators_makefile.cpp) = d163cfbf8e598123dd1ed2f9bb5e6935b4e5bf64
SHA1 (patch-src-tools-mocmain.cpp-QTBUG-22829) = 79ffa61f856d657be054d1ea2fcab3a90740621e
+SHA1 (patch-src_3rdparty_clucene_src_CLucene_config_repl__tchar.h) = 3f19ae44da341afc4ebfe32a2eb80e38c3307648
SHA1 (patch-src_3rdparty_clucene_src_CLucene_index_SegmentMerger.cpp) = 8f43ece880786f7dc9352322d922c7fff652a36f
SHA1 (patch-src_3rdparty_clucene_src_CLucene_search_FieldCacheImpl.cpp) = 4f03369a9e5681f5babe8f6d5f8aaf560f45a855
SHA1 (patch-src_3rdparty_clucene_src_CLucene_util_Arrays.h) = 41c2cf95b81157f3809acb7bd82fe7e098e2abb8
SHA1 (patch-src_3rdparty_javascriptcore_JavaScriptCore_interpreter_Interpreter.cpp) = a9e94ed9becb0d5a88b30f721048509cd0d6b5a5
+SHA1 (patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.cpp) = 156e99fa8594470be4e89e212408258824044e41
+SHA1 (patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.h) = b822a84aae7e125cb56b01bffdcfec07060d88f6
+SHA1 (patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_HashTable.h) = a63219598a2bd6b6e660fb15ccebec3b327a60d1
+SHA1 (patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_RefCountedLeakCounter.h) = 3b70ecb3a95944a3dd4a26c7b5c53e44aa89de1a
+SHA1 (patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_Threading.h) = d1ff007f2070a57aba65e9eac49c9b3df7f3a583
SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MachineStackMarker.cpp) = cbce2e10307d26163a76266c0ceee315a609d63d
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.cpp) = c7c9c39b11007e7ec3884874a38d000e3238bf64
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.h) = bf748efe8d150fe636cbc5b20dcd9a7d4945c8c9
SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_jit_JITStubs.cpp) = bfe38ea1e26fef02dd78e40c95c000cb0cc32a04
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_parser_JSParser.cpp) = 95eb0e9aa01aedf148bd0ad53a59a1418081e623
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Atomics.h) = 38d34aa7df1214cadd8e82c857d7056e2deda429
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_HashSet.h) = 25654a9f2cedb17b5f536b324e47d56eb4010029
SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_MathExtras.h) = 68152f0077ec5bcce1b3774aaac64af5fd9e491e
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_NullPtr.h) = 0c2c47ed2f522d17ce44f3f3c17ca0655a4c5b0b
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_RefCountedLeakCounter.h) = fc4686c018471fcae375d9382737e0844a0f45a8
SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_StringImpl.h) = d5460bede6b3662df4d9dbec5826db98c6ef4f61
-SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h) = 10bfe59d623db5047e2a4c678ee79a217ea8b7ec
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_ThreadSafeRefCounted.h) = 2d3176beb56697d033387ab10729cfb6681d01c7
+SHA1 (patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h) = fa7519ef6ac04cd13be085783f663c329e4a14be
SHA1 (patch-src_3rdparty_webkit_Source_WebCore_features.pri) = d0053dd2732604908fcec294b2a833aeb6d93f40
SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_DefaultLocalizationStrategy.cpp) = 0377066bd28d5eae02e8fcf200da4360c286ad84
+SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.cpp) = 6327c7ea52b5a91adc5b96319c29c8ffd994524e
+SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.h) = b1cc159d1e9e792666f0099b1439782429ccb82f
SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_graphics_MediaPlayer.cpp) = f9a1f71b4607c5f542c059873cf5735fad9ff3a1
+SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_network_qt_QNetworkReplyHandler.cpp) = 29e0c55ed578b546682154c5df4d53d3ed298d7b
SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_qt_PlatformKeyboardEventQt.cpp) = b28cf71983f8e71b82b1c634a10b3898ca13ede5
+SHA1 (patch-src_3rdparty_webkit_Source_WebKit_qt_Api_qgraphicswebview.cpp) = 87518d8aa1363d9d56358d69f896593369cf0ba9
+SHA1 (patch-src_3rdparty_webkit_Source_WebKit_qt_WebCoreSupport_NotificationPresenterClientQt.cpp) = 1a3417f521d238a845a0afc750fcf3e2a71c2fc8
SHA1 (patch-src_corelib_animation_qpropertyanimation.cpp) = c6fb5cdfed1013f904b4a194d3c9fcab86a2327c
SHA1 (patch-src_corelib_io_io.pri) = cde98927b524c92fae1e053c2359e77bde2c240a
SHA1 (patch-src_corelib_io_qfilesystemwatcher.cpp) = bb16b95d20286b1aa069dc25843d7e0067cc0268
+SHA1 (patch-src_corelib_tools_qiterator.h) = 40c4807719e6555a40f6a738330ad5037d6c80ad
SHA1 (patch-src_declarative_util_qdeclarativefontloader.cpp) = 0bb76eac102a4325cadb5bcb4e7a1ac85a3d099f
SHA1 (patch-src_network_ssl_qsslsocket__openssl__symbols.cpp) = 3ad682b86d2e9bd2b282caa298508dc3e9dd8566
SHA1 (patch-src_network_ssl_qsslsocket__openssl__symbols__p.h) = 417846ba9edab8638cafa41a54ef60029467ef80
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_clucene_src_CLucene_config_repl__tchar.h b/x11/qt4-libs/patches/patch-src_3rdparty_clucene_src_CLucene_config_repl__tchar.h
new file mode 100644
index 00000000000..603c21a0d4a
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_clucene_src_CLucene_config_repl__tchar.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_3rdparty_clucene_src_CLucene_config_repl__tchar.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/clucene/src/CLucene/config/repl_tchar.h.orig 2012-11-23 10:10:12.000000000 +0000
++++ src/3rdparty/clucene/src/CLucene/config/repl_tchar.h
+@@ -33,7 +33,7 @@
+ #define _tcscpy wcscpy //copy a string to another string
+ #define _tcsncpy wcsncpy //copy a specified amount of one string to another string.
+ #define _tcscat wcscat //copy a string onto the end of the other string
+- #define _tcschr wcschr //find location of one character
++ #define _tcschr ::std::wcschr //find location of one character
+ #define _tcsstr wcsstr //find location of a string
+ #define _tcslen wcslen //get length of a string
+ #define _tcscmp wcscmp //case sensitive compare two strings
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.cpp b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.cpp
new file mode 100644
index 00000000000..9f2a3a83c62
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.cpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.cpp,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp.orig 2013-05-08 13:07:22.000000000 +0000
++++ src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp
+@@ -156,9 +156,10 @@ Structure::Structure(JSValue prototype,
+ Structure::~Structure()
+ {
+ if (m_previous) {
+- if (m_nameInPrevious)
+- m_previous->table.remove(StructureTransitionTableHash::Key(RefPtr<UString::Rep>(m_nameInPrevious.get()), m_attributesInPrevious), m_specificValueInPrevious);
+- else
++ if (m_nameInPrevious) {
++ unsigned attrPrev = m_attributesInPrevious;
++ m_previous->table.remove(StructureTransitionTableHash::Key(RefPtr<UString::Rep>(m_nameInPrevious.get()), attrPrev), m_specificValueInPrevious);
++ } else
+ m_previous->table.removeAnonymousSlotTransition(m_anonymousSlotsInPrevious);
+
+ }
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.h b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.h
new file mode 100644
index 00000000000..e141b1e984c
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_3rdparty_javascriptcore_JavaScriptCore_runtime_Structure.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h.orig 2013-05-08 12:51:54.000000000 +0000
++++ src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h
+@@ -316,8 +316,10 @@ namespace JSC {
+ Structure* existingTransition = singleTransition();
+ TransitionTable* transitionTable = new TransitionTable;
+ setTransitionTable(transitionTable);
+- if (existingTransition)
+- add(StructureTransitionTableHash::Key(RefPtr<UString::Rep>(existingTransition->m_nameInPrevious.get()), existingTransition->m_attributesInPrevious), existingTransition, existingTransition->m_specificValueInPrevious);
++ if (existingTransition) {
++ unsigned attrPrev = existingTransition->m_attributesInPrevious;
++ add(StructureTransitionTableHash::Key(RefPtr<UString::Rep>(existingTransition->m_nameInPrevious.get()), attrPrev), existingTransition, existingTransition->m_specificValueInPrevious);
++ }
+ }
+ } // namespace JSC
+
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_HashTable.h b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_HashTable.h
new file mode 100644
index 00000000000..103c1ff796d
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_HashTable.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_HashTable.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h.orig 2013-04-29 18:21:34.000000000 +0000
++++ src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h
+@@ -257,7 +257,7 @@ namespace WTF {
+
+ using std::swap;
+
+-#if !COMPILER(MSVC) && !OS(QNX)
++#if !COMPILER(MSVC) && !OS(QNX) && !defined(_LIBCPP_VERSION)
+ // The Dinkumware C++ library (used by MSVC and QNX) has a swap for pairs defined.
+
+ // swap pairs by component, in case of pair members that specialize swap
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_RefCountedLeakCounter.h b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_RefCountedLeakCounter.h
new file mode 100644
index 00000000000..5bffa012270
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_RefCountedLeakCounter.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_RefCountedLeakCounter.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefCountedLeakCounter.h.orig 2013-05-08 13:14:49.000000000 +0000
++++ src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefCountedLeakCounter.h
+@@ -38,7 +38,7 @@ namespace WTF {
+
+ #ifndef NDEBUG
+ private:
+- volatile int m_count;
++ atomic_int m_count;
+ const char* m_description;
+ #endif
+ };
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_Threading.h b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_Threading.h
new file mode 100644
index 00000000000..4342d6296d7
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_Threading.h
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_3rdparty_javascriptcore_JavaScriptCore_wtf_Threading.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h.orig 2013-04-29 18:12:16.000000000 +0000
++++ src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+@@ -78,7 +78,9 @@
+ #elif OS(QNX)
+ #include <atomic.h>
+ #elif COMPILER(GCC) && !OS(SYMBIAN)
+-#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
++#include <ciso646>
++#ifdef _LIBCPP_VERSION
++#elif (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
+ #include <ext/atomicity.h>
+ #else
+ #include <bits/atomicity.h>
+@@ -250,8 +252,13 @@ inline int atomicDecrement(int volatile*
+ #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc
+ #define WTF_USE_LOCKFREE_THREADSAFESHARED 1
+
++#ifdef _LIBCPP_VERSION
++inline int atomicIncrement(int volatile* addend) { return __sync_fetch_and_add(addend, 1) + 1; }
++inline int atomicDecrement(int volatile* addend) { return __sync_fetch_and_add(addend, -1) - 1; }
++#else
+ inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; }
+ inline int atomicDecrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, -1) - 1; }
++#endif
+
+ #endif
+
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.cpp b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.cpp
new file mode 100644
index 00000000000..ffc49c87ecd
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.cpp
@@ -0,0 +1,37 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.cpp,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/JavaScriptCore/heap/MarkedSpace.cpp.orig 2013-05-08 14:48:50.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/heap/MarkedSpace.cpp
+@@ -124,8 +124,8 @@ void MarkedSpace::sweep()
+ size_t MarkedSpace::objectCount() const
+ {
+ size_t result = 0;
+- BlockIterator end = m_blocks.end();
+- for (BlockIterator it = m_blocks.begin(); it != end; ++it)
++ ConstBlockIterator end = m_blocks.end();
++ for (ConstBlockIterator it = m_blocks.begin(); it != end; ++it)
+ result += (*it)->markCount();
+ return result;
+ }
+@@ -133,8 +133,8 @@ size_t MarkedSpace::objectCount() const
+ size_t MarkedSpace::size() const
+ {
+ size_t result = 0;
+- BlockIterator end = m_blocks.end();
+- for (BlockIterator it = m_blocks.begin(); it != end; ++it)
++ ConstBlockIterator end = m_blocks.end();
++ for (ConstBlockIterator it = m_blocks.begin(); it != end; ++it)
+ result += (*it)->size();
+ return result;
+ }
+@@ -142,8 +142,8 @@ size_t MarkedSpace::size() const
+ size_t MarkedSpace::capacity() const
+ {
+ size_t result = 0;
+- BlockIterator end = m_blocks.end();
+- for (BlockIterator it = m_blocks.begin(); it != end; ++it)
++ ConstBlockIterator end = m_blocks.end();
++ for (ConstBlockIterator it = m_blocks.begin(); it != end; ++it)
+ result += (*it)->capacity();
+ return result;
+ }
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.h b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.h
new file mode 100644
index 00000000000..5792c1a3425
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.h
@@ -0,0 +1,12 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_heap_MarkedSpace.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/JavaScriptCore/heap/MarkedSpace.h.orig 2013-05-08 14:49:13.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/heap/MarkedSpace.h
+@@ -92,6 +92,7 @@ namespace JSC {
+ static const size_t impreciseCount = impreciseCutoff / impreciseStep - 1;
+
+ typedef HashSet<MarkedBlock*>::iterator BlockIterator;
++ typedef HashSet<MarkedBlock*>::const_iterator ConstBlockIterator;
+
+ struct SizeClass {
+ SizeClass();
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_parser_JSParser.cpp b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_parser_JSParser.cpp
new file mode 100644
index 00000000000..72fec02993b
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_parser_JSParser.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_parser_JSParser.cpp,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/JavaScriptCore/parser/JSParser.cpp.orig 2013-05-08 15:01:59.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/parser/JSParser.cpp
+@@ -453,8 +453,8 @@ private:
+
+ void copyCapturedVariablesToVector(const IdentifierSet& capturedVariables, Vector<RefPtr<StringImpl> >& vector)
+ {
+- IdentifierSet::iterator end = capturedVariables.end();
+- for (IdentifierSet::iterator it = capturedVariables.begin(); it != end; ++it) {
++ IdentifierSet::const_iterator end = capturedVariables.end();
++ for (IdentifierSet::const_iterator it = capturedVariables.begin(); it != end; ++it) {
+ if (m_declaredVariables.contains(*it))
+ continue;
+ vector.append(*it);
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Atomics.h b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Atomics.h
new file mode 100644
index 00000000000..a16db0561ae
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Atomics.h
@@ -0,0 +1,44 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Atomics.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/Atomics.h.orig 2012-11-23 10:10:05.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/Atomics.h
+@@ -61,7 +61,9 @@
+
+ #include "Platform.h"
+
+-#if OS(WINDOWS)
++#if __cplusplus >= 201103L
++#include <atomic>
++#elif OS(WINDOWS)
+ #include <windows.h>
+ #elif OS(DARWIN)
+ #include <libkern/OSAtomic.h>
+@@ -79,7 +82,11 @@
+
+ namespace WTF {
+
+-#if OS(WINDOWS)
++#if __cplusplus >= 201103L
++#define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1
++inline int atomicIncrement(std::atomic<int> * addend) { return *addend++; }
++inline int atomicDecrement(std::atomic<int> * addend) { return *addend--; }
++#elif OS(WINDOWS)
+ #define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1
+
+ #if COMPILER(MINGW) || COMPILER(MSVC7_OR_LOWER) || OS(WINCE)
+@@ -114,9 +126,15 @@ inline int atomicDecrement(int volatile*
+
+ #endif
+
++#if __cplusplus >= 201103L
++typedef std::atomic<int> atomic_int;
++#else
++typedef int volatile atomic_int;
++#endif
+ } // namespace WTF
+
+ #if USE(LOCKFREE_THREADSAFEREFCOUNTED)
++using WTF::atomic_int;
+ using WTF::atomicDecrement;
+ using WTF::atomicIncrement;
+ #endif
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_HashSet.h b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_HashSet.h
new file mode 100644
index 00000000000..97372c0d935
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_HashSet.h
@@ -0,0 +1,104 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_HashSet.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h.orig 2013-05-08 14:26:07.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
+@@ -49,7 +49,7 @@ namespace WTF {
+ HashFunctions, ValueTraits, ValueTraits> HashTableType;
+
+ public:
+- typedef HashTableConstIteratorAdapter<HashTableType, ValueType> iterator;
++ typedef HashTableIteratorAdapter<HashTableType, ValueType> iterator;
+ typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator;
+
+ void swap(HashSet&);
+@@ -58,10 +58,14 @@ namespace WTF {
+ int capacity() const;
+ bool isEmpty() const;
+
+- iterator begin() const;
+- iterator end() const;
++ iterator begin();
++ iterator end();
+
+- iterator find(const ValueType&) const;
++ const_iterator begin() const;
++ const_iterator end() const;
++
++ iterator find(const ValueType&);
++ const_iterator find(const ValueType&) const;
+ bool contains(const ValueType&) const;
+
+ // An alternate version of find() that finds the object by hashing and comparing
+@@ -69,7 +73,8 @@ namespace WTF {
+ // must have the following function members:
+ // static unsigned hash(const T&);
+ // static bool equal(const ValueType&, const T&);
+- template<typename T, typename HashTranslator> iterator find(const T&) const;
++ template<typename T, typename HashTranslator> iterator find(const T&);
++ template<typename T, typename HashTranslator> const_iterator find(const T&) const;
+ template<typename T, typename HashTranslator> bool contains(const T&) const;
+
+ // The return value is a pair of an interator to the new value's location,
+@@ -134,19 +139,37 @@ namespace WTF {
+ }
+
+ template<typename T, typename U, typename V>
+- inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::begin() const
++ inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::begin()
+ {
+ return m_impl.begin();
+ }
+
+ template<typename T, typename U, typename V>
+- inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::end() const
++ inline typename HashSet<T, U, V>::const_iterator HashSet<T, U, V>::begin() const
++ {
++ return m_impl.begin();
++ }
++
++ template<typename T, typename U, typename V>
++ inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::end()
+ {
+ return m_impl.end();
+ }
+
+ template<typename T, typename U, typename V>
+- inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::find(const ValueType& value) const
++ inline typename HashSet<T, U, V>::const_iterator HashSet<T, U, V>::end() const
++ {
++ return m_impl.end();
++ }
++
++ template<typename T, typename U, typename V>
++ inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::find(const ValueType& value)
++ {
++ return m_impl.find(value);
++ }
++
++ template<typename T, typename U, typename V>
++ inline typename HashSet<T, U, V>::const_iterator HashSet<T, U, V>::find(const ValueType& value) const
+ {
+ return m_impl.find(value);
+ }
+@@ -160,10 +183,21 @@ namespace WTF {
+ template<typename Value, typename HashFunctions, typename Traits>
+ template<typename T, typename HashTranslator>
+ typename HashSet<Value, HashFunctions, Traits>::iterator
++ inline HashSet<Value, HashFunctions, Traits>::find(const T& value)
++ {
++ typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
++ return m_impl.template find<T, Adapter>(value);
++
++ }
++
++ template<typename Value, typename HashFunctions, typename Traits>
++ template<typename T, typename HashTranslator>
++ typename HashSet<Value, HashFunctions, Traits>::const_iterator
+ inline HashSet<Value, HashFunctions, Traits>::find(const T& value) const
+ {
+ typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
+ return m_impl.template find<T, Adapter>(value);
++
+ }
+
+ template<typename Value, typename HashFunctions, typename Traits>
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_NullPtr.h b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_NullPtr.h
new file mode 100644
index 00000000000..bc4523e88cc
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_NullPtr.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_NullPtr.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h.orig 2013-04-29 18:43:12.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h
+@@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
+ #define __has_feature(feature) 0
+ #endif
+
+-#if __has_feature(cxx_nullptr) || (GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && _MSC_VER >= 1600 && !COMPILER(INTEL))
++#if __has_feature(cxx_nullptr) || (GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && _MSC_VER >= 1600 && !COMPILER(INTEL)) || defined(_LIBCPP_VERSION)
+
+ #define HAVE_NULLPTR 1
+
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_RefCountedLeakCounter.h b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_RefCountedLeakCounter.h
new file mode 100644
index 00000000000..0e897d9cec2
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_RefCountedLeakCounter.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_RefCountedLeakCounter.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/RefCountedLeakCounter.h.orig 2013-05-08 13:34:56.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/RefCountedLeakCounter.h
+@@ -38,7 +38,7 @@ namespace WTF {
+
+ #ifndef NDEBUG
+ private:
+- volatile int m_count;
++ atomic_int m_count;
+ const char* m_description;
+ #endif
+ };
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_ThreadSafeRefCounted.h b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_ThreadSafeRefCounted.h
new file mode 100644
index 00000000000..3bd964e0434
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_ThreadSafeRefCounted.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_ThreadSafeRefCounted.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/ThreadSafeRefCounted.h.orig 2013-05-08 13:26:56.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/ThreadSafeRefCounted.h
+@@ -96,7 +96,7 @@ public:
+ #if !USE(LOCKFREE_THREADSAFEREFCOUNTED)
+ MutexLocker locker(m_mutex);
+ #endif
+- return static_cast<int const volatile &>(m_refCount);
++ return m_refCount;
+ }
+
+ protected:
+@@ -126,7 +126,7 @@ private:
+ template<class T>
+ friend class CrossThreadRefCounted;
+
+- int m_refCount;
++ atomic_int m_refCount;
+ #if !USE(LOCKFREE_THREADSAFEREFCOUNTED)
+ mutable Mutex m_mutex;
+ #endif
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h
index 6c452cc49c8..75d86ae07ac 100644
--- a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h
@@ -1,7 +1,7 @@
-$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h,v 1.1 2012/02/16 20:42:46 hans Exp $
+$NetBSD: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Threading.h,v 1.2 2013/05/09 14:07:08 joerg Exp $
---- src/3rdparty/webkit/Source/JavaScriptCore/wtf/Threading.h.orig 2011-12-08 06:06:02.000000000 +0100
-+++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/Threading.h 2012-01-15 02:04:00.160127709 +0100
+--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/Threading.h.orig 2012-11-23 10:10:05.000000000 +0000
++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/Threading.h
@@ -113,6 +113,8 @@ using WTF::createThread;
using WTF::currentThread;
using WTF::detachThread;
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.cpp b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.cpp
new file mode 100644
index 00000000000..99914957cef
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.cpp
@@ -0,0 +1,248 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.cpp,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+Upstream changeset 92556
+
+--- src/3rdparty/webkit/Source/WebCore/platform/Timer.cpp.orig 2012-11-23 10:09:58.000000000 +0000
++++ src/3rdparty/webkit/Source/WebCore/platform/Timer.cpp
+@@ -41,6 +41,8 @@ using namespace std;
+
+ namespace WebCore {
+
++class TimerHeapReference;
++
+ // Timers are stored in a heap data structure, used to implement a priority queue.
+ // This allows us to efficiently determine which timer needs to fire the soonest.
+ // Then we set a single shared system timer to fire at that time.
+@@ -53,110 +55,138 @@ static Vector<TimerBase*>& timerHeap()
+ return threadGlobalData().threadTimers().timerHeap();
+ }
+
+-// Class to represent elements in the heap when calling the standard library heap algorithms.
+-// Maintains the m_heapIndex value in the timers themselves, which allows us to do efficient
+-// modification of the heap.
+-class TimerHeapElement {
+-public:
+- explicit TimerHeapElement(int i)
+- : m_index(i)
+- , m_timer(timerHeap()[m_index])
+- {
+- checkConsistency();
+- }
+-
+- TimerHeapElement(const TimerHeapElement&);
+- TimerHeapElement& operator=(const TimerHeapElement&);
+-
+- TimerBase* timer() const { return m_timer; }
+-
+- void checkConsistency() const
+- {
+- ASSERT(m_index >= 0);
+- ASSERT(m_index < static_cast<int>(timerHeap().size()));
+- }
++// ----------------
+
++class TimerHeapPointer {
++public:
++ TimerHeapPointer(TimerBase** pointer) : m_pointer(pointer) { }
++ TimerHeapReference operator*() const;
++ TimerBase* operator->() const { return *m_pointer; }
+ private:
+- TimerHeapElement();
++ TimerBase** m_pointer;
++};
+
+- int m_index;
+- TimerBase* m_timer;
++class TimerHeapReference {
++public:
++ TimerHeapReference(TimerBase*& reference) : m_reference(reference) { }
++ operator TimerBase*() const { return m_reference; }
++ TimerHeapPointer operator&() const { return &m_reference; }
++ TimerHeapReference& operator=(TimerBase*);
++ TimerHeapReference& operator=(TimerHeapReference);
++private:
++ TimerBase*& m_reference;
+ };
+
+-inline TimerHeapElement::TimerHeapElement(const TimerHeapElement& o)
+- : m_index(-1), m_timer(o.timer())
++inline TimerHeapReference TimerHeapPointer::operator*() const
+ {
++ return *m_pointer;
+ }
+
+-inline TimerHeapElement& TimerHeapElement::operator=(const TimerHeapElement& o)
++inline TimerHeapReference& TimerHeapReference::operator=(TimerBase* timer)
+ {
+- TimerBase* t = o.timer();
+- m_timer = t;
+- if (m_index != -1) {
+- checkConsistency();
+- timerHeap()[m_index] = t;
+- t->m_heapIndex = m_index;
+- }
++ m_reference = timer;
++ Vector<TimerBase*>& heap = timerHeap();
++ if (&m_reference >= heap.data() && &m_reference < heap.data() + heap.size())
++ timer->m_heapIndex = &m_reference - heap.data();
+ return *this;
+ }
+
+-inline bool operator<(const TimerHeapElement& a, const TimerHeapElement& b)
++inline TimerHeapReference& TimerHeapReference::operator=(TimerHeapReference b)
+ {
+- // The comparisons below are "backwards" because the heap puts the largest
+- // element first and we want the lowest time to be the first one in the heap.
+- double aFireTime = a.timer()->m_nextFireTime;
+- double bFireTime = b.timer()->m_nextFireTime;
+- if (bFireTime != aFireTime)
+- return bFireTime < aFireTime;
+-
+- // We need to look at the difference of the insertion orders instead of comparing the two
+- // outright in case of overflow.
+- unsigned difference = a.timer()->m_heapInsertionOrder - b.timer()->m_heapInsertionOrder;
+- return difference < UINT_MAX / 2;
++ TimerBase* timer = b;
++ return *this = timer;
++}
++
++inline void swap(TimerHeapReference a, TimerHeapReference b)
++{
++ TimerBase* timerA = a;
++ TimerBase* timerB = b;
++
++ // Invoke the assignment operator, since that takes care of updating m_heapIndex.
++ a = timerB;
++ b = timerA;
+ }
+
+ // ----------------
+
+ // Class to represent iterators in the heap when calling the standard library heap algorithms.
+-// Returns TimerHeapElement for elements in the heap rather than the TimerBase pointers themselves.
+-class TimerHeapIterator : public iterator<random_access_iterator_tag, TimerHeapElement, int> {
++// Uses a custom pointer and reference type that update indices for pointers in the heap.
++class TimerHeapIterator : public iterator<random_access_iterator_tag, TimerBase*, ptrdiff_t, TimerHeapPointer, TimerHeapReference> {
+ public:
+- TimerHeapIterator() : m_index(-1) { }
+- TimerHeapIterator(int i) : m_index(i) { checkConsistency(); }
+-
+- TimerHeapIterator& operator++() { checkConsistency(); ++m_index; checkConsistency(); return *this; }
+- TimerHeapIterator operator++(int) { checkConsistency(); checkConsistency(1); return m_index++; }
++ explicit TimerHeapIterator(TimerBase** pointer) : m_pointer(pointer) { checkConsistency(); }
+
+- TimerHeapIterator& operator--() { checkConsistency(); --m_index; checkConsistency(); return *this; }
+- TimerHeapIterator operator--(int) { checkConsistency(); checkConsistency(-1); return m_index--; }
++ TimerHeapIterator& operator++() { checkConsistency(); ++m_pointer; checkConsistency(); return *this; }
++ TimerHeapIterator operator++(int) { checkConsistency(1); return TimerHeapIterator(m_pointer++); }
+
+- TimerHeapIterator& operator+=(int i) { checkConsistency(); m_index += i; checkConsistency(); return *this; }
+- TimerHeapIterator& operator-=(int i) { checkConsistency(); m_index -= i; checkConsistency(); return *this; }
++ TimerHeapIterator& operator--() { checkConsistency(); --m_pointer; checkConsistency(); return *this; }
++ TimerHeapIterator operator--(int) { checkConsistency(-1); return TimerHeapIterator(m_pointer--); }
+
+- TimerHeapElement operator*() const { return TimerHeapElement(m_index); }
+- TimerHeapElement operator[](int i) const { return TimerHeapElement(m_index + i); }
++ TimerHeapIterator& operator+=(ptrdiff_t i) { checkConsistency(); m_pointer += i; checkConsistency(); return *this; }
++ TimerHeapIterator& operator-=(ptrdiff_t i) { checkConsistency(); m_pointer -= i; checkConsistency(); return *this; }
+
+- int index() const { return m_index; }
++ TimerHeapReference operator*() const { return TimerHeapReference(*m_pointer); }
++ TimerHeapReference operator[](ptrdiff_t i) const { return TimerHeapReference(m_pointer[i]); }
++ TimerBase* operator->() const { return *m_pointer; }
+
+- void checkConsistency(int offset = 0) const
++private:
++ void checkConsistency(ptrdiff_t offset = 0) const
+ {
+- ASSERT_UNUSED(offset, m_index + offset >= 0);
+- ASSERT_UNUSED(offset, m_index + offset <= static_cast<int>(timerHeap().size()));
++ ASSERT(m_pointer >= timerHeap().data());
++ ASSERT(m_pointer <= timerHeap().data() + timerHeap().size());
++ ASSERT_UNUSED(offset, m_pointer + offset >= timerHeap().data());
++ ASSERT_UNUSED(offset, m_pointer + offset <= timerHeap().data() + timerHeap().size());
+ }
+
+-private:
+- int m_index;
++ friend bool operator==(TimerHeapIterator, TimerHeapIterator);
++ friend bool operator!=(TimerHeapIterator, TimerHeapIterator);
++ friend bool operator<(TimerHeapIterator, TimerHeapIterator);
++ friend bool operator>(TimerHeapIterator, TimerHeapIterator);
++ friend bool operator<=(TimerHeapIterator, TimerHeapIterator);
++ friend bool operator>=(TimerHeapIterator, TimerHeapIterator);
++
++ friend TimerHeapIterator operator+(TimerHeapIterator, size_t);
++ friend TimerHeapIterator operator+(size_t, TimerHeapIterator);
++
++ friend TimerHeapIterator operator-(TimerHeapIterator, size_t);
++ friend ptrdiff_t operator-(TimerHeapIterator, TimerHeapIterator);
++
++ TimerBase** m_pointer;
+ };
+
+-inline bool operator==(TimerHeapIterator a, TimerHeapIterator b) { return a.index() == b.index(); }
+-inline bool operator!=(TimerHeapIterator a, TimerHeapIterator b) { return a.index() != b.index(); }
+-inline bool operator<(TimerHeapIterator a, TimerHeapIterator b) { return a.index() < b.index(); }
++inline bool operator==(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer == b.m_pointer; }
++inline bool operator!=(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer != b.m_pointer; }
++inline bool operator<(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer < b.m_pointer; }
++inline bool operator>(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer > b.m_pointer; }
++inline bool operator<=(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer <= b.m_pointer; }
++inline bool operator>=(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer >= b.m_pointer; }
++
++inline TimerHeapIterator operator+(TimerHeapIterator a, size_t b) { return TimerHeapIterator(a.m_pointer + b); }
++inline TimerHeapIterator operator+(size_t a, TimerHeapIterator b) { return TimerHeapIterator(a + b.m_pointer); }
+
+-inline TimerHeapIterator operator+(TimerHeapIterator a, int b) { return a.index() + b; }
+-inline TimerHeapIterator operator+(int a, TimerHeapIterator b) { return a + b.index(); }
++inline TimerHeapIterator operator-(TimerHeapIterator a, size_t b) { return TimerHeapIterator(a.m_pointer - b); }
++inline ptrdiff_t operator-(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer - b.m_pointer; }
+
+-inline TimerHeapIterator operator-(TimerHeapIterator a, int b) { return a.index() - b; }
+-inline int operator-(TimerHeapIterator a, TimerHeapIterator b) { return a.index() - b.index(); }
++// ----------------
++
++class TimerHeapLessThanFunction {
++public:
++ bool operator()(TimerBase*, TimerBase*) const;
++};
++
++inline bool TimerHeapLessThanFunction::operator()(TimerBase* a, TimerBase* b) const
++{
++ // The comparisons below are "backwards" because the heap puts the largest
++ // element first and we want the lowest time to be the first one in the heap.
++ double aFireTime = a->m_nextFireTime;
++ double bFireTime = b->m_nextFireTime;
++ if (bFireTime != aFireTime)
++ return bFireTime < aFireTime;
++
++ // We need to look at the difference of the insertion orders instead of comparing the two
++ // outright in case of overflow.
++ unsigned difference = a->m_heapInsertionOrder - b->m_heapInsertionOrder;
++ return difference < numeric_limits<unsigned>::max() / 2;
++}
+
+ // ----------------
+
+@@ -225,7 +255,8 @@ void TimerBase::heapDecreaseKey()
+ {
+ ASSERT(m_nextFireTime != 0);
+ checkHeapIndex();
+- push_heap(TimerHeapIterator(0), TimerHeapIterator(m_heapIndex + 1));
++ TimerBase** heapData = timerHeap().data();
++ push_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + m_heapIndex + 1), TimerHeapLessThanFunction());
+ checkHeapIndex();
+ }
+
+@@ -274,7 +305,9 @@ void TimerBase::heapPopMin()
+ {
+ ASSERT(this == timerHeap().first());
+ checkHeapIndex();
+- pop_heap(TimerHeapIterator(0), TimerHeapIterator(timerHeap().size()));
++ Vector<TimerBase*>& heap = timerHeap();
++ TimerBase** heapData = heap.data();
++ pop_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + heap.size()), TimerHeapLessThanFunction());
+ checkHeapIndex();
+ ASSERT(this == timerHeap().last());
+ }
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.h b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.h
new file mode 100644
index 00000000000..27554584312
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.h
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+Upstream changeset 92556
+
+--- src/3rdparty/webkit/Source/WebCore/platform/Timer.h.orig 2012-11-23 10:09:58.000000000 +0000
++++ src/3rdparty/webkit/Source/WebCore/platform/Timer.h
+@@ -84,9 +84,9 @@ private:
+ ThreadIdentifier m_thread;
+ #endif
+
+- friend class TimerHeapElement;
+ friend class ThreadTimers;
+- friend bool operator<(const TimerHeapElement&, const TimerHeapElement&);
++ friend class TimerHeapLessThanFunction;
++ friend class TimerHeapReference;
+ };
+
+ template <typename TimerFiredClass> class Timer : public TimerBase {
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_network_qt_QNetworkReplyHandler.cpp b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_network_qt_QNetworkReplyHandler.cpp
new file mode 100644
index 00000000000..5be5154e7da
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebCore_platform_network_qt_QNetworkReplyHandler.cpp
@@ -0,0 +1,73 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_WebCore_platform_network_qt_QNetworkReplyHandler.cpp,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp.orig 2013-05-03 13:04:45.000000000 +0000
++++ src/3rdparty/webkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+@@ -235,7 +235,7 @@ QNetworkReply* QNetworkReplyWrapper::rel
+ resetConnections();
+ QNetworkReply* reply = m_reply;
+ m_reply = 0;
+- m_sniffer = 0;
++ m_sniffer = nullptr;
+
+ reply->setParent(0);
+ return reply;
+@@ -300,7 +300,7 @@ void QNetworkReplyWrapper::receiveSniffe
+ Q_ASSERT(m_sniffer);
+
+ m_sniffedMIMEType = m_sniffer->mimeType();
+- m_sniffer = 0;
++ m_sniffer = nullptr;
+
+ emitMetaDataChanged();
+ }
+@@ -417,7 +417,7 @@ QNetworkReply* QNetworkReplyHandler::rel
+ return 0;
+
+ QNetworkReply* reply = m_replyWrapper->release();
+- m_replyWrapper = 0;
++ m_replyWrapper = nullptr;
+ return reply;
+ }
+
+@@ -440,12 +440,12 @@ void QNetworkReplyHandler::finish()
+
+ ResourceHandleClient* client = m_resourceHandle->client();
+ if (!client) {
+- m_replyWrapper = 0;
++ m_replyWrapper = nullptr;
+ return;
+ }
+
+ if (m_replyWrapper->wasRedirected()) {
+- m_replyWrapper = 0;
++ m_replyWrapper = nullptr;
+ m_queue.push(&QNetworkReplyHandler::start);
+ return;
+ }
+@@ -465,7 +465,7 @@ void QNetworkReplyHandler::finish()
+ }
+ }
+
+- m_replyWrapper = 0;
++ m_replyWrapper = nullptr;
+ }
+
+ void QNetworkReplyHandler::sendResponseIfNeeded()
+@@ -539,7 +539,7 @@ void QNetworkReplyHandler::redirect(Reso
+ newUrl.toString(),
+ QCoreApplication::translate("QWebPage", "Redirection limit reached"));
+ client->didFail(m_resourceHandle, error);
+- m_replyWrapper = 0;
++ m_replyWrapper = nullptr;
+ return;
+ }
+
+@@ -666,7 +666,7 @@ void QNetworkReplyHandler::start()
+ if (!reply)
+ return;
+
+- m_replyWrapper = new QNetworkReplyWrapper(&m_queue, reply, m_resourceHandle->shouldContentSniff() && d->m_context->mimeSniffingEnabled(), this);
++ m_replyWrapper = adoptPtr(new QNetworkReplyWrapper(&m_queue, reply, m_resourceHandle->shouldContentSniff() && d->m_context->mimeSniffingEnabled(), this));
+
+ if (m_loadType == SynchronousLoad) {
+ m_replyWrapper->synchronousLoad();
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebKit_qt_Api_qgraphicswebview.cpp b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebKit_qt_Api_qgraphicswebview.cpp
new file mode 100644
index 00000000000..8c0190df1a4
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebKit_qt_Api_qgraphicswebview.cpp
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_WebKit_qt_Api_qgraphicswebview.cpp,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/WebKit/qt/Api/qgraphicswebview.cpp.orig 2013-05-03 13:55:03.000000000 +0000
++++ src/3rdparty/webkit/Source/WebKit/qt/Api/qgraphicswebview.cpp
+@@ -471,7 +471,7 @@ void QGraphicsWebViewPrivate::detachCurr
+ return;
+
+ page->d->view.clear();
+- page->d->client = 0;
++ page->d->client = nullptr;
+
+ // if the page was created by us, we own it and need to
+ // destroy it as well.
+@@ -504,7 +504,7 @@ void QGraphicsWebView::setPage(QWebPage*
+ if (!d->page)
+ return;
+
+- d->page->d->client = new PageClientQGraphicsWidget(this, page); // set the page client
++ d->page->d->client = adoptPtr(new PageClientQGraphicsWidget(this, page)); // set the page client
+
+ if (d->overlay())
+ d->overlay()->prepareGraphicsItemGeometryChange();
diff --git a/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebKit_qt_WebCoreSupport_NotificationPresenterClientQt.cpp b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebKit_qt_WebCoreSupport_NotificationPresenterClientQt.cpp
new file mode 100644
index 00000000000..d7ed5c83e34
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_3rdparty_webkit_Source_WebKit_qt_WebCoreSupport_NotificationPresenterClientQt.cpp
@@ -0,0 +1,28 @@
+$NetBSD: patch-src_3rdparty_webkit_Source_WebKit_qt_WebCoreSupport_NotificationPresenterClientQt.cpp,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp.orig 2013-05-03 13:43:43.000000000 +0000
++++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
+@@ -73,9 +73,9 @@ NotificationWrapper::NotificationWrapper
+ #if ENABLE(NOTIFICATIONS)
+
+ #ifndef QT_NO_SYSTEMTRAYICON
+- m_notificationIcon = 0;
++ m_notificationIcon = nullptr;
+ #endif
+- m_presenter = 0;
++ m_presenter = nullptr;
+ #endif
+ }
+
+@@ -211,9 +211,9 @@ void NotificationPresenterClientQt::disp
+ QPixmap pixmap;
+ if (bytes.length() && pixmap.loadFromData(bytes)) {
+ QIcon icon(pixmap);
+- wrapper->m_notificationIcon = new QSystemTrayIcon(icon);
++ wrapper->m_notificationIcon = adoptPtr(new QSystemTrayIcon(icon));
+ } else
+- wrapper->m_notificationIcon = new QSystemTrayIcon();
++ wrapper->m_notificationIcon = adoptPtr(new QSystemTrayIcon());
+ #endif
+ }
+
diff --git a/x11/qt4-libs/patches/patch-src_corelib_tools_qiterator.h b/x11/qt4-libs/patches/patch-src_corelib_tools_qiterator.h
new file mode 100644
index 00000000000..5642044f43f
--- /dev/null
+++ b/x11/qt4-libs/patches/patch-src_corelib_tools_qiterator.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_corelib_tools_qiterator.h,v 1.1 2013/05/09 14:07:08 joerg Exp $
+
+--- src/corelib/tools/qiterator.h.orig 2013-05-09 12:25:20.000000000 +0000
++++ src/corelib/tools/qiterator.h
+@@ -47,10 +47,7 @@
+ QT_BEGIN_HEADER
+
+ #ifdef QT_NO_STL
+-namespace std {
+- struct bidirectional_iterator_tag;
+- struct random_access_iterator_tag;
+-}
++#include <iterator>
+ #endif
+
+ QT_BEGIN_NAMESPACE