summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-05-30 11:49:40 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-23 21:34:12 +0200
commit48baeef0766ba145d26d374561e152b40245f3b8 (patch)
tree33cfe32cd730b5c9a2bc5e520070432418ed550c
parent013146e1e0c7d20621e85e3e79d79a2309411640 (diff)
downloadqtscript-48baeef0766ba145d26d374561e152b40245f3b8.tar.gz
Compile with clang's libc++
An overload for std::swap() what works with std::pair<A,B> is included in libc++ (but not libstdc++). Avoid ambiguity in HashTable.h by omitting the version there and using the std::swap() version. Collector.cpp needs to include pthread.h directly, as it is not automatically included by libc++'s headers (libstdc++ does pull in pthread.h though). Change-Id: I20ffe5a745900d1cfa1e489ebf4376e454eded5f Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
index a7744dd..36269ff 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
@@ -52,6 +52,8 @@
#include <mach/task.h>
#include <mach/thread_act.h>
#include <mach/vm_map.h>
+// clang's libc++ headers does not pull in pthread.h (but libstdc++ does)
+#include <pthread.h>
#elif OS(WINDOWS)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h
index bea9daa..42a9233 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h
@@ -257,8 +257,8 @@ namespace WTF {
using std::swap;
-#if !COMPILER(MSVC) && !OS(QNX)
- // The Dinkumware C++ library (used by MSVC and QNX) has a swap for pairs defined.
+#if !COMPILER(MSVC) && !OS(QNX) && !defined(_LIBCPP_VERSION)
+ // The Dinkumware C++ library (used by MSVC and QNX) and clang's libc++ have a swap for pairs defined.
// swap pairs by component, in case of pair members that specialize swap
template<typename T, typename U> inline void swap(pair<T, U>& a, pair<T, U>& b)