diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2012-05-30 09:49:40 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-10 15:23:32 (GMT) |
commit | 952b046ba5bc99986f747729681914e21f8fb8b0 (patch) | |
tree | a4682f9de279a4ed7f13a31e8e48c8a0bc9646f9 | |
parent | 264f201136c4fffeaa131a9ae562187ad2ef45ad (diff) | |
download | Qt-952b046ba5bc99986f747729681914e21f8fb8b0.zip Qt-952b046ba5bc99986f747729681914e21f8fb8b0.tar.gz Qt-952b046ba5bc99986f747729681914e21f8fb8b0.tar.bz2 |
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).
Cherry-picked from qtscript/48baeef0766ba145d26d374561e152b40245f3b8.
Change-Id: I4dc88638ce8553bb97037b841fc6cc5e8c9911e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h | 4 |
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 6af1784..711949b 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) |