summaryrefslogtreecommitdiff
path: root/src/atomic_counter.hpp
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2010-02-18 19:38:15 +0100
committerMartin Lucina <mato@kotelna.sk>2010-02-18 19:38:15 +0100
commit2a79a943de417679c562cd4a917e1d1bc19b0d25 (patch)
tree43ce287a60b07a4c4c9ba879606594e2bf6b7b9a /src/atomic_counter.hpp
parent776b12633981fd95050e138daeeba00a65d9532b (diff)
Add NetBSD support
Diffstat (limited to 'src/atomic_counter.hpp')
-rw-r--r--src/atomic_counter.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/atomic_counter.hpp b/src/atomic_counter.hpp
index 649fdbf..4a77928 100644
--- a/src/atomic_counter.hpp
+++ b/src/atomic_counter.hpp
@@ -31,8 +31,8 @@
#define ZMQ_ATOMIC_COUNTER_SPARC
#elif defined ZMQ_HAVE_WINDOWS
#define ZMQ_ATOMIC_COUNTER_WINDOWS
-#elif defined ZMQ_HAVE_SOLARIS
-#define ZMQ_ATOMIC_COUNTER_SOLARIS
+#elif (defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_NETBSD)
+#define ZMQ_ATOMIC_COUNTER_SYSTEM
#else
#define ZMQ_ATOMIC_COUNTER_MUTEX
#endif
@@ -41,7 +41,7 @@
#include "mutex.hpp"
#elif defined ZMQ_ATOMIC_COUNTER_WINDOWS
#include "windows.hpp"
-#elif defined ZMQ_ATOMIC_COUNTER_SOLARIS
+#elif defined ZMQ_ATOMIC_COUNTER_SYSTEM
#include <atomic.h>
#endif
@@ -79,7 +79,7 @@ namespace zmq
#if defined ZMQ_ATOMIC_COUNTER_WINDOWS
old_value = InterlockedExchangeAdd ((LONG*) &value, increment_);
-#elif defined ZMQ_ATOMIC_COUNTER_SOLARIS
+#elif defined ZMQ_ATOMIC_COUNTER_SYSTEM
integer_t new_value = atomic_add_32_nv (&value, increment_);
old_value = new_value - increment_;
#elif defined ZMQ_ATOMIC_COUNTER_X86
@@ -119,7 +119,7 @@ namespace zmq
LONG delta = - ((LONG) decrement);
integer_t old = InterlockedExchangeAdd ((LONG*) &value, delta);
return old - decrement != 0;
-#elif defined ZMQ_ATOMIC_COUNTER_SOLARIS
+#elif defined ZMQ_ATOMIC_COUNTER_SYSTEM
int32_t delta = - ((int32_t) decrement);
integer_t nv = atomic_add_32_nv (&value, delta);
return nv != 0;
@@ -180,8 +180,8 @@ namespace zmq
#if defined ZMQ_ATOMIC_COUNTER_WINDOWS
#undef ZMQ_ATOMIC_COUNTER_WINDOWS
#endif
-#if defined ZMQ_ATOMIC_COUNTER_SOLARIS
-#undef ZMQ_ATOMIC_COUNTER_SOLARIS
+#if defined ZMQ_ATOMIC_COUNTER_SYSTEM
+#undef ZMQ_ATOMIC_COUNTER_SYSTEM
#endif
#if defined ZMQ_ATOMIC_COUNTER_X86
#undef ZMQ_ATOMIC_COUNTER_X86