Skip to content

Commit

Permalink
Merge pull request #39 from zbierak/master
Browse files Browse the repository at this point in the history
Fixes backward compatibility with zmq 3.x
  • Loading branch information
hintjens committed Aug 8, 2014
2 parents ce806ee + a819813 commit 96e0576
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zmq.hpp
Expand Up @@ -492,11 +492,15 @@ namespace zmq
if (rc == -1 && zmq_errno() == ETERM)
break;
assert (rc != -1);
#if ZMQ_VERSION_MAJOR >= 4
const char* data = static_cast<const char*>(zmq_msg_data(&eventMsg));
zmq_event_t msgEvent;
msgEvent.event = *(uint16_t*)data; data += sizeof(uint16_t);
msgEvent.value = *(int32_t*)data;
zmq_event_t* event = &msgEvent;
#else
zmq_event_t* event = static_cast<zmq_event_t*>(zmq_msg_data(&eventMsg));
#endif

#ifdef ZMQ_NEW_MONITOR_EVENT_LAYOUT
zmq_msg_t addrMsg;
Expand Down

0 comments on commit 96e0576

Please sign in to comment.