*/
-typedef int hb_atomic_int_impl_t;
-
/* We need external help for these */
#if defined(hb_atomic_int_impl_add) \
#define _hb_memory_w_barrier() __machine_w_barrier ()
#define _hb_memory_barrier() __machine_rw_barrier ()
-static inline int _hb_fetch_and_add (hb_atomic_int_impl_t *AI, int V)
+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);
#define _hb_memory_barrier() __lwsync ()
-static inline int _hb_fetch_and_add (hb_atomic_int_impl_t *AI, int V)
+static inline int _hb_fetch_and_add (int *AI, int V)
{
_hb_memory_barrier ();
int result = __fetch_and_add (AI, V);
#ifndef _hb_memory_w_barrier
#define _hb_memory_w_barrier() _hb_memory_barrier ()
#endif
-#ifndef HB_ATOMIC_INT_INIT
-#define HB_ATOMIC_INT_INIT(V) {V}
-#endif
#ifndef hb_atomic_int_impl_set_relaxed
#define hb_atomic_int_impl_set_relaxed(AI, V) (*(AI) = (V))
#endif
#endif
+#define HB_ATOMIC_INT_INIT(V) {V}
struct hb_atomic_int_t
{
- mutable hb_atomic_int_impl_t v;
-
inline void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); }
inline int get_relaxed (void) const { return hb_atomic_int_impl_get_relaxed (&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); }
+
+ mutable int v;
};