diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh index 265de1267ac..9321932e06f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh @@ -104,7 +104,7 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) #include <windows.h> -static inline void _hb_memory_barrier (void) +static inline void _hb_memory_barrier () { #if !defined(MemoryBarrier) /* MinGW has a convoluted history of supporting MemoryBarrier. */ @@ -143,7 +143,7 @@ static_assert ((sizeof (LONG) == sizeof (int)), ""); static inline int _hb_fetch_and_add (int *AI, int V) { _hb_memory_w_barrier (); - int result = atomic_add_int_nv ((uint_t *) AI, V); + int result = atomic_add_int_nv ((uint_t *) AI, V) - V; _hb_memory_r_barrier (); return result; } @@ -267,12 +267,12 @@ inline void *hb_atomic_ptr_impl_get (void ** const P) { void *v = *P; _hb_memory #define HB_ATOMIC_INT_INIT(V) {V} struct hb_atomic_int_t { - inline void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); } - inline void set (int v_) { hb_atomic_int_impl_set (&v, v_); } - inline int get_relaxed (void) const { return hb_atomic_int_impl_get_relaxed (&v); } - inline int get (void) const { return hb_atomic_int_impl_get (&v); } - inline int inc (void) { return hb_atomic_int_impl_add (&v, 1); } - inline int dec (void) { return hb_atomic_int_impl_add (&v, -1); } + void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); } + void set (int v_) { hb_atomic_int_impl_set (&v, v_); } + int get_relaxed () const { return hb_atomic_int_impl_get_relaxed (&v); } + int get () const { return hb_atomic_int_impl_get (&v); } + int inc () { return hb_atomic_int_impl_add (&v, 1); } + int dec () { return hb_atomic_int_impl_add (&v, -1); } int v; }; @@ -284,14 +284,14 @@ struct hb_atomic_ptr_t { typedef typename hb_remove_pointer (P) T; - inline void init (T* v_ = nullptr) { set_relaxed (v_); } - inline void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); } - inline T *get_relaxed (void) const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } - inline T *get (void) const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } - inline bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); } + void init (T* v_ = nullptr) { set_relaxed (v_); } + void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); } + T *get_relaxed () const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } + T *get () const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } + bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); } - inline T * operator -> (void) const { return get (); } - template <typename C> inline operator C * (void) const { return get (); } + T * operator -> () const { return get (); } + template <typename C> operator C * () const { return get (); } T *v; }; |