Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- include/qemu/atomic.h | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 7e13fca..acf8f68 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -152,6 +152,9 @@ _old; \ }) +#define atomic_inc_fetch(ptr) __sync_add_and_fetch(ptr, 1) +#define atomic_dec_fetch(ptr) __sync_add_and_fetch(ptr, -1) + /* Provide shorter names for GCC atomic builtins, return old value */ #define atomic_fetch_inc(ptr) __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST) #define atomic_fetch_dec(ptr) __atomic_fetch_sub(ptr, 1, __ATOMIC_SEQ_CST) -- 2.8.3