11 #ifndef MSGPACK_GCC_ATOMIC_HPP 12 #define MSGPACK_GCC_ATOMIC_HPP 14 #if defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41) 16 #include "msgpack/gcc_atomic.h" 17 #include <bits/atomicity.h> 19 int _msgpack_sync_decr_and_fetch(
volatile _msgpack_atomic_counter_t* ptr)
21 return __gnu_cxx::__exchange_and_add(ptr, -1) - 1;
24 int _msgpack_sync_incr_and_fetch(
volatile _msgpack_atomic_counter_t* ptr)
26 return __gnu_cxx::__exchange_and_add(ptr, 1) + 1;
29 #endif // old gcc workaround