Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit e2f5b69

Browse files
t-bbourtemb
authored andcommitted
zmqeventconsumer/zmqeventsupplier: Make it compatible with all stock cppzmq versions
Depending on the cppzmq version from https://github.com/zeromq/cppzmq the operator void* is either implicit or explicit. We could now add a feature check in cmake to check for that and use code paths for each variant. But we could also be really pragmatic and just use a unconditional static_cast<void*>. Idea and initial patch by Michal Liszcz.
1 parent 2f9ad4a commit e2f5b69

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cppapi/client/zmqeventconsumer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ void *ZmqEventConsumer::run_undetached(TANGO_UNUSED(void *arg))
181181
zmq::pollitem_t *items = new zmq::pollitem_t [MAX_SOCKET_SUB];
182182
int nb_poll_item = 3;
183183

184-
items[0].socket = *control_sock;
185-
items[1].socket = *heartbeat_sub_sock;
186-
items[2].socket = *event_sub_sock;
184+
items[0].socket = static_cast<void*>(*control_sock);
185+
items[1].socket = static_cast<void*>(*heartbeat_sub_sock);
186+
items[2].socket = static_cast<void*>(*event_sub_sock);
187187

188188
for (int loop = 0;loop < nb_poll_item;loop++)
189189
{
@@ -1063,7 +1063,7 @@ bool ZmqEventConsumer::process_ctrl(zmq::message_t &received_ctrl,zmq::pollitem_
10631063
// Update poll item list
10641064
//
10651065

1066-
poll_list[old_poll_nb].socket = *tmp_sock;
1066+
poll_list[old_poll_nb].socket = static_cast<void*>(*tmp_sock);
10671067
poll_list[old_poll_nb].fd = 0;
10681068
poll_list[old_poll_nb].events = ZMQ_POLLIN;
10691069
poll_list[old_poll_nb].revents = 0;

cppapi/server/zmqeventsupplier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ void ZmqEventSupplier::create_mcast_socket(string &mcast_data,int rate,McastSock
686686
// Bind the publisher socket to the specified port
687687
//
688688

689-
if (zmq_bind(*(ms.pub_socket),ms.endpoint.c_str()) != 0)
689+
if (zmq_bind(static_cast<void*>(*ms.pub_socket),ms.endpoint.c_str()) != 0)
690690
{
691691
TangoSys_OMemStream o;
692692
o << "Can't bind ZMQ socket with endpoint ";

0 commit comments

Comments
 (0)