Skip to content

Commit 96e0576

Browse files
committed
Merge pull request #39 from zbierak/master
Fixes backward compatibility with zmq 3.x
2 parents ce806ee + a819813 commit 96e0576

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

zmq.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,15 @@ namespace zmq
492492
if (rc == -1 && zmq_errno() == ETERM)
493493
break;
494494
assert (rc != -1);
495+
#if ZMQ_VERSION_MAJOR >= 4
495496
const char* data = static_cast<const char*>(zmq_msg_data(&eventMsg));
496497
zmq_event_t msgEvent;
497498
msgEvent.event = *(uint16_t*)data; data += sizeof(uint16_t);
498499
msgEvent.value = *(int32_t*)data;
499500
zmq_event_t* event = &msgEvent;
501+
#else
502+
zmq_event_t* event = static_cast<zmq_event_t*>(zmq_msg_data(&eventMsg));
503+
#endif
500504

501505
#ifdef ZMQ_NEW_MONITOR_EVENT_LAYOUT
502506
zmq_msg_t addrMsg;

0 commit comments

Comments
 (0)