mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 13:47:13 +01:00
Clean-up: Rename internal macros consistently.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
#if defined ZMQ_FORCE_MUTEXES
|
||||
#define ZMQ_ATOMIC_COUNTER_MUTEX
|
||||
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
|
||||
#define ZMQ_ATOMIC_INTRINSIC
|
||||
#define ZMQ_ATOMIC_COUNTER_INTRINSIC
|
||||
#elif (defined ZMQ_CXX11 && defined __cplusplus && __cplusplus >= 201103L)
|
||||
#define ZMQ_ATOMIC_COUNTER_CXX11
|
||||
#elif (defined __i386__ || defined __x86_64__) && defined __GNUC__
|
||||
@@ -99,7 +99,7 @@ namespace zmq
|
||||
|
||||
#if defined ZMQ_ATOMIC_COUNTER_WINDOWS
|
||||
old_value = InterlockedExchangeAdd ((LONG*) &value, increment_);
|
||||
#elif defined ZMQ_ATOMIC_INTRINSIC
|
||||
#elif defined ZMQ_ATOMIC_COUNTER_INTRINSIC
|
||||
old_value = __atomic_fetch_add(&value, increment_, __ATOMIC_ACQ_REL);
|
||||
#elif defined ZMQ_ATOMIC_COUNTER_CXX11
|
||||
old_value = value.fetch_add(increment_, std::memory_order_acq_rel);
|
||||
@@ -145,7 +145,7 @@ namespace zmq
|
||||
LONG delta = - ((LONG) decrement);
|
||||
integer_t old = InterlockedExchangeAdd ((LONG*) &value, delta);
|
||||
return old - decrement != 0;
|
||||
#elif defined ZMQ_ATOMIC_INTRINSIC
|
||||
#elif defined ZMQ_ATOMIC_COUNTER_INTRINSIC
|
||||
integer_t nv = __atomic_sub_fetch(&value, decrement, __ATOMIC_ACQ_REL);
|
||||
return nv != 0;
|
||||
#elif defined ZMQ_ATOMIC_COUNTER_CXX11
|
||||
@@ -219,7 +219,7 @@ namespace zmq
|
||||
|
||||
// Remove macros local to this file.
|
||||
#undef ZMQ_ATOMIC_COUNTER_MUTEX
|
||||
#undef ZMQ_ATOMIC_INTRINSIC
|
||||
#undef ZMQ_ATOMIC_COUNTER_INTRINSIC
|
||||
#undef ZMQ_ATOMIC_COUNTER_CXX11
|
||||
#undef ZMQ_ATOMIC_COUNTER_X86
|
||||
#undef ZMQ_ATOMIC_COUNTER_ARM
|
||||
|
||||
Reference in New Issue
Block a user