mirror of
https://github.com/taglib/taglib.git
synced 2025-07-25 08:24:29 -04:00
Make use of increment/decrement operators of std::atomic.
This commit is contained in:
@ -31,9 +31,9 @@
|
||||
|
||||
#if defined(HAVE_STD_ATOMIC)
|
||||
# include <atomic>
|
||||
# define ATOMIC_INT std::atomic<unsigned int>
|
||||
# define ATOMIC_INC(x) x.fetch_add(1)
|
||||
# define ATOMIC_DEC(x) (x.fetch_sub(1) - 1)
|
||||
# define ATOMIC_INT std::atomic_int
|
||||
# define ATOMIC_INC(x) (++x)
|
||||
# define ATOMIC_DEC(x) (--x)
|
||||
#elif defined(HAVE_GCC_ATOMIC)
|
||||
# define ATOMIC_INT int
|
||||
# define ATOMIC_INC(x) __sync_add_and_fetch(&x, 1)
|
||||
|
Reference in New Issue
Block a user