1 #ifndef CLIENTS_MS_ATOMIC_H
2 #define CLIENTS_MS_ATOMIC_H
10 inline int32_t __sync_add_and_fetch(volatile int32_t* ptr
, int32_t val
)
12 (val
== 1) ? atomic_inc_32((volatile uint32_t*)ptr
) : atomic_add_32((volatile uint32_t*)ptr
, val
);
17 inline uint32_t __sync_sub_and_fetch(volatile uint32_t* ptr
, uint32_t val
)
19 (val
== 1) ? atomic_dec_32(ptr
) : atomic_add_32(ptr
, 0-(int32_t)val
);
23 #endif /* defined(__SUNC) */
24 #endif /* CLIENTS_MS_ATOMIC_H */