mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-05-02 15:41:40 +02:00
Prevent unused variable warning in presence of assertions.
This commit is contained in:
parent
73fd092572
commit
0483ee0dfa
14
zmq.hpp
14
zmq.hpp
@ -47,6 +47,14 @@
|
|||||||
#define ZMQ_HAS_RVALUE_REFS
|
#define ZMQ_HAS_RVALUE_REFS
|
||||||
#endif
|
#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
|
namespace zmq
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -118,7 +126,7 @@ namespace zmq
|
|||||||
inline ~message_t ()
|
inline ~message_t ()
|
||||||
{
|
{
|
||||||
int rc = zmq_msg_close (&msg);
|
int rc = zmq_msg_close (&msg);
|
||||||
assert (rc == 0);
|
ZMQ_ASSERT (rc == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void rebuild ()
|
inline void rebuild ()
|
||||||
@ -217,7 +225,7 @@ namespace zmq
|
|||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
return;
|
return;
|
||||||
int rc = zmq_term (ptr);
|
int rc = zmq_term (ptr);
|
||||||
assert (rc == 0);
|
ZMQ_ASSERT (rc == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Be careful with this, it's probably only useful for
|
// Be careful with this, it's probably only useful for
|
||||||
@ -275,7 +283,7 @@ namespace zmq
|
|||||||
// already closed
|
// already closed
|
||||||
return ;
|
return ;
|
||||||
int rc = zmq_close (ptr);
|
int rc = zmq_close (ptr);
|
||||||
assert (rc == 0);
|
ZMQ_ASSERT (rc == 0);
|
||||||
ptr = 0 ;
|
ptr = 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user