diff options
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh | 19 | ||||
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-private.hh | 10 |
2 files changed, 19 insertions, 10 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh index e6738b7d9f..48eb56141f 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh @@ -41,6 +41,25 @@ #if 0 +#elif !defined(HB_NO_MT) && defined(HAVE_QT5_ATOMICS) +#include <QtCore/qatomic.h> + +QT_USE_NAMESPACE + +namespace { +// We need to cast hb_atomic_int_t to QAtomicInt and pointers to +// QAtomicPointer instead of using QAtomicOps, otherwise we get a failed +// overload resolution of the template arguments for testAndSetOrdered. +template <typename T> QAtomicPointer<T> *makeAtomicPointer(T * const &ptr) +{ + return reinterpret_cast<QAtomicPointer<T> *>(const_cast<T **>(&ptr)); +} +} + +typedef int hb_atomic_int_t; +#define hb_atomic_int_add(AI, V) reinterpret_cast<QAtomicInt &>(AI).fetchAndAddOrdered(V) +#define hb_atomic_ptr_get(P) makeAtomicPointer(*P)->loadAcquire() +#define hb_atomic_ptr_cmpexch(P,O,N) makeAtomicPointer(*P)->testAndSetOrdered((O), (N)) #elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__)) diff --git a/src/3rdparty/harfbuzz-ng/src/hb-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-private.hh index 45b7712ce8..cfe77f1606 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-private.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-private.hh @@ -94,16 +94,6 @@ # endif #endif -#ifdef _MSC_VER -#undef inline -#define inline __inline -#endif - -#ifdef __STRICT_ANSI__ -#undef inline -#define inline __inline__ -#endif - #if __GNUC__ >= 3 #define HB_FUNC __PRETTY_FUNCTION__ #elif defined(_MSC_VER) |