From 144de35b8c770d6698e1e6a11a37cbcc24ca4e8b Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Wed, 18 Jan 2012 18:39:05 +0100 Subject: Fixes Javascript WTF to build with BB NDK. Change-Id: I89d72b2b1c166b826d4367bcb1384c2c5263d5f4 Reviewed-by: Simon Hausmann Reviewed-by: Kent Hansen Reviewed-by: Sean Harmer --- src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h | 4 ++-- src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h index 92533fa..bea9daa 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) - // Visual C++ has a swap for pairs defined. +#if !COMPILER(MSVC) && !OS(QNX) + // 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 template inline void swap(pair& a, pair& b) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h index 920a4d7..8b76c0f 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h @@ -75,6 +75,8 @@ #include #elif OS(ANDROID) #include +#elif OS(QNX) +#include #elif COMPILER(GCC) && !OS(SYMBIAN) #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) #include @@ -239,6 +241,12 @@ inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Bar inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); } inline int atomicDecrement(int volatile* addend) { return android_atomic_dec(addend); } +#elif OS(QNX) + +// component functions take and return unsigned +inline int atomicIncrement(int volatile* addend) { return (int) atomic_add_value((unsigned volatile*)addend, 1); } +inline int atomicDecrement(int volatile* addend) { return (int) atomic_sub_value((unsigned volatile*)addend, 1); } + #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc #define WTF_USE_LOCKFREE_THREADSAFESHARED 1 -- cgit v0.12