diff options
author | Michael Dickens <michael.dickens@ettus.com> | 2019-05-26 14:36:53 -0400 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-06-15 17:20:15 -0700 |
commit | 82251fad9cf3314124d4a91e97a35f6b0f78e5bb (patch) | |
tree | 430fc2e0cd40b3d6d27def0293ea759bb0029e6b /gr-zeromq/lib/base_impl.cc | |
parent | 6996d1b7ee20fb7611068906bb64886eb5b514ef (diff) |
zeromq: fixes to allow building using CPPZMQ 4.3.1 as well as prior
CPPZMQ deprecated some prototypes of "recv" and "send" in some version prior to 4.3.1. The "recv" one will be removed in 4.3.1 and thus will generate an error since no valid prototype exists in the way "recv" is currently being call. This fix updates our usage of both calls to work with the "new" and "old" ways, depending on the CPPZMQ version. Move the CPPZMQ header inclusion and a macro determine which version to use into a common local header.
Diffstat (limited to 'gr-zeromq/lib/base_impl.cc')
-rw-r--r-- | gr-zeromq/lib/base_impl.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gr-zeromq/lib/base_impl.cc b/gr-zeromq/lib/base_impl.cc index 0465ec3abb..662f7b1596 100644 --- a/gr-zeromq/lib/base_impl.cc +++ b/gr-zeromq/lib/base_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2016 Free Software Foundation, Inc. + * Copyright 2016,2019 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -105,7 +105,11 @@ namespace gr { } /* Send */ +#if USE_NEW_CPPZMQ_SEND_RECV + d_socket->send(msg, zmq::send_flags::none); +#else d_socket->send(msg); +#endif /* Report back */ return in_nitems; @@ -186,7 +190,11 @@ namespace gr { d_consumed_bytes = 0; /* Get the message */ +#if USE_NEW_CPPZMQ_SEND_RECV + d_socket->recv(d_msg); +#else d_socket->recv(&d_msg); +#endif /* Parse header from the first (or only) message of a multi-part message */ if (d_pass_tags && !more) |