summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2014-02-25 13:02:11 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-25 13:11:00 (GMT)
commit427d50dc257b8e11844c7e295c56d674a8dfad94 (patch)
tree959000d3265d5c5b74786e48e75da197b3f1d0f0 /src
parenteefff4ac4b6915485d6362536fe0907820a68982 (diff)
downloadQt-427d50dc257b8e11844c7e295c56d674a8dfad94.zip
Qt-427d50dc257b8e11844c7e295c56d674a8dfad94.tar.gz
Qt-427d50dc257b8e11844c7e295c56d674a8dfad94.tar.bz2
Fix building of JSC for earlier versions of gcc on Mac
Since building for Carbon typically uses older versions of gcc on older versions of Mac, then we need to revert 0de22e80ac645afc3793419300d6271d95809196 partially in order to fix this. Since the original code was just a cleanup then this is safe to do so. Change-Id: I5dd8fe99704ffac66ac3384b62849fa8162ca82d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
index b3ea7d2..9b49db3 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
@@ -71,10 +71,18 @@
#if OS(WINDOWS) && !OS(WINCE)
#include <windows.h>
+#elif OS(DARWIN)
+#include <libkern/OSAtomic.h>
#elif OS(ANDROID)
#include <cutils/atomic.h>
#elif OS(QNX)
#include <atomic.h>
+#elif COMPILER(GCC) && !OS(SYMBIAN)
+#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
+#include <ext/atomicity.h>
+#else
+#include <bits/atomicity.h>
+#endif
#endif
#if USE(PTHREADS)
@@ -222,6 +230,12 @@ inline int atomicIncrement(int volatile* addend) { return InterlockedIncrement(r
inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast<long volatile*>(addend)); }
#endif
+#elif OS(DARWIN)
+#define WTF_USE_LOCKFREE_THREADSAFESHARED 1
+
+inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast<int*>(addend)); }
+inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast<int*>(addend)); }
+
#elif OS(ANDROID)
inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); }