Skip to content

Commit 7c3d374

Browse files
committed
Merge pull request #57 from gdfast/patch-1
Avoid using deprecated function zmq_recvmsg
2 parents fadb37e + 5989203 commit 7c3d374

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

zmq.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ typedef struct {
8686
} zmq_event_t;
8787
#endif
8888

89+
// Avoid using deprecated message receive function when possible
90+
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3, 2, 0)
91+
# define zmq_msg_recv zmq_recvmsg
92+
#endif
93+
94+
8995
// In order to prevent unused variable warnings when building in non-debug
9096
// mode use this macro to make assertions.
9197
#ifndef NDEBUG
@@ -657,7 +663,7 @@ namespace zmq
657663
while (true) {
658664
zmq_msg_t eventMsg;
659665
zmq_msg_init (&eventMsg);
660-
rc = zmq_recvmsg (s, &eventMsg, 0);
666+
rc = zmq_msg_recv (s, &eventMsg, 0);
661667
if (rc == -1 && zmq_errno() == ETERM)
662668
break;
663669
assert (rc != -1);
@@ -674,7 +680,7 @@ namespace zmq
674680
#ifdef ZMQ_NEW_MONITOR_EVENT_LAYOUT
675681
zmq_msg_t addrMsg;
676682
zmq_msg_init (&addrMsg);
677-
rc = zmq_recvmsg (s, &addrMsg, 0);
683+
rc = zmq_msg_recv (s, &addrMsg, 0);
678684
if (rc == -1 && zmq_errno() == ETERM)
679685
break;
680686
assert (rc != -1);

0 commit comments

Comments
 (0)