summaryrefslogtreecommitdiff
path: root/include/zmq.hpp
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2012-05-20 11:24:59 +0200
committerMartin Lucina <martin@lucina.net>2012-05-20 11:24:59 +0200
commite4a32d2c3227d8e2f3a2a3a3cb51bd021f57a8c2 (patch)
tree10978c613cca68ab3733e7d51c5c4963464f18df /include/zmq.hpp
parent0118255d0413fa469c0a7c569e05cc79bf5f5b7d (diff)
parent56619463ac26dc6c3e576d2fbf6b544eebeb5148 (diff)
Merge tag 'upstream/2.2.0'
Upstream version 2.2.0
Diffstat (limited to 'include/zmq.hpp')
-rw-r--r--include/zmq.hpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/zmq.hpp b/include/zmq.hpp
index bfba0f6..0db6738 100644
--- a/include/zmq.hpp
+++ b/include/zmq.hpp
@@ -23,6 +23,7 @@
#include "zmq.h"
+#include <algorithm>
#include <cassert>
#include <cstring>
#include <exception>
@@ -40,6 +41,14 @@
# define ZMQ_HAS_RVALUE_REFS
#endif
+// In order to prevent unused variable warnings when building in non-debug
+// mode use this macro to make assertions.
+#ifndef NDEBUG
+# define ZMQ_ASSERT(expression) assert(expression)
+#else
+# define ZMQ_ASSERT(expression) (expression)
+#endif
+
namespace zmq
{
@@ -118,7 +127,7 @@ namespace zmq
inline ~message_t ()
{
int rc = zmq_msg_close (this);
- assert (rc == 0);
+ ZMQ_ASSERT (rc == 0);
}
inline void rebuild ()
@@ -214,7 +223,7 @@ namespace zmq
if (ptr == NULL)
return;
int rc = zmq_term (ptr);
- assert (rc == 0);
+ ZMQ_ASSERT (rc == 0);
}
// Be careful with this, it's probably only useful for