Skip to content

Commit 3431f68

Browse files
sqbingbluca
authored andcommitted
fix build error with libzmq-3.2.5 (#103)
error zmq_send_const undefined and zmq_msg_gets undefined
1 parent 229e7a8 commit 3431f68

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

zmq.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,15 @@ namespace zmq
372372
return a == b;
373373
}
374374

375+
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 0, 8)
375376
inline const char* gets(const char *property_)
376377
{
377378
const char* value = zmq_msg_gets (&msg, property_);
378379
if (value == NULL)
379380
throw error_t ();
380381
return value;
381382
}
383+
#endif
382384

383385
private:
384386
// The underlying message
@@ -622,7 +624,11 @@ namespace zmq
622624

623625
inline size_t send (const void *buf_, size_t len_, int flags_ = 0)
624626
{
627+
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 0, 8)
625628
int nbytes = zmq_send_const (ptr, buf_, len_, flags_);
629+
#else
630+
int nbytes = zmq_send (ptr, buf_, len_, flags_);
631+
#endif
626632
if (nbytes >= 0)
627633
return (size_t) nbytes;
628634
if (zmq_errno () == EAGAIN)

0 commit comments

Comments
 (0)