Skip to content

Commit

Permalink
Remove warnings on Homebrew (#150)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Aguero <caguero@openrobotics.org>
Co-authored-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
caguero and chapulina authored Jul 24, 2020
1 parent 17b2077 commit d4420b8
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 47 deletions.
4 changes: 2 additions & 2 deletions include/ignition/transport/Helpers.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#define STR(x) STR_HELPER(x)

// Avoid using deprecated message send/receive function when possible.
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 4, 0)
#define IGN_ZMQ_POST_4_4_0
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 1)
#define IGN_ZMQ_POST_4_3_1
#endif

namespace ignition
Expand Down
5 changes: 5 additions & 0 deletions src/Node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,13 @@ bool Node::Unsubscribe(const std::string &_topic)
if (!this->dataPtr->shared->localSubscribers
.HasSubscriber(fullyQualifiedTopic))
{
#if (CPPZMQ_VERSION >= 40700)
this->dataPtr->shared->dataPtr->subscriber->set(
zmq::sockopt::unsubscribe, fullyQualifiedTopic);
#else
this->dataPtr->shared->dataPtr->subscriber->setsockopt(
ZMQ_UNSUBSCRIBE, fullyQualifiedTopic.data(), fullyQualifiedTopic.size());
#endif
}

// Notify to the publishers that I am no longer interested in the topic.
Expand Down
Loading

0 comments on commit d4420b8

Please sign in to comment.