mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-05-21 21:26:36 +02:00
fix build error with libzmq-3.2.5 (#103)
error zmq_send_const undefined and zmq_msg_gets undefined
This commit is contained in:
parent
229e7a849b
commit
3431f6882a
6
zmq.hpp
6
zmq.hpp
@ -372,6 +372,7 @@ namespace zmq
|
|||||||
return a == b;
|
return a == b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 0, 8)
|
||||||
inline const char* gets(const char *property_)
|
inline const char* gets(const char *property_)
|
||||||
{
|
{
|
||||||
const char* value = zmq_msg_gets (&msg, property_);
|
const char* value = zmq_msg_gets (&msg, property_);
|
||||||
@ -379,6 +380,7 @@ namespace zmq
|
|||||||
throw error_t ();
|
throw error_t ();
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The underlying message
|
// The underlying message
|
||||||
@ -622,7 +624,11 @@ namespace zmq
|
|||||||
|
|
||||||
inline size_t send (const void *buf_, size_t len_, int flags_ = 0)
|
inline size_t send (const void *buf_, size_t len_, int flags_ = 0)
|
||||||
{
|
{
|
||||||
|
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 0, 8)
|
||||||
int nbytes = zmq_send_const (ptr, buf_, len_, flags_);
|
int nbytes = zmq_send_const (ptr, buf_, len_, flags_);
|
||||||
|
#else
|
||||||
|
int nbytes = zmq_send (ptr, buf_, len_, flags_);
|
||||||
|
#endif
|
||||||
if (nbytes >= 0)
|
if (nbytes >= 0)
|
||||||
return (size_t) nbytes;
|
return (size_t) nbytes;
|
||||||
if (zmq_errno () == EAGAIN)
|
if (zmq_errno () == EAGAIN)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user