From 7bfd709fe0a6212bb4be9987c7416b33643674d1 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Mon, 21 Oct 2019 12:21:05 +0200 Subject: [PATCH] Add already obsoleted loaned message interfaces The rmw_return_loaned_message and rmw_release_loaned_message functions are still expected by rcl, even if they are scheduled to be replaced. We need a working build, so add them for now. Signed-off-by: Erik Boasson --- rmw_cyclonedds_cpp/src/rmw_node.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rmw_cyclonedds_cpp/src/rmw_node.cpp b/rmw_cyclonedds_cpp/src/rmw_node.cpp index 07e08df..3a94e7c 100644 --- a/rmw_cyclonedds_cpp/src/rmw_node.cpp +++ b/rmw_cyclonedds_cpp/src/rmw_node.cpp @@ -1237,6 +1237,16 @@ extern "C" rmw_ret_t rmw_return_loaned_message_from_publisher( return RMW_RET_UNSUPPORTED; } +extern "C" rmw_ret_t rmw_return_loaned_message( + const rmw_publisher_t * publisher, + void * loaned_message) +{ + /* https://github.com/ros2/rmw/pull/192 replaces this one with + rmw_return_loaned_message_from_publisher, but until that PR is accepted, this one is + needed to make things build & work */ + return rmw_return_loaned_message_from_publisher(publisher, loaned_message); +} + extern "C" rmw_ret_t rmw_destroy_publisher(rmw_node_t * node, rmw_publisher_t * publisher) { RET_WRONG_IMPLID(node); @@ -1593,6 +1603,16 @@ extern "C" rmw_ret_t rmw_return_loaned_message_from_subscription( return RMW_RET_UNSUPPORTED; } +extern "C" rmw_ret_t rmw_release_loaned_message( + const rmw_subscription_t * subscription, + void * loaned_message) +{ + /* https://github.com/ros2/rmw/pull/192 replaces this one with + rmw_return_loaned_message_from_subscription, but until that PR is accepted, this one + is needed to make things build & work */ + return rmw_return_loaned_message_from_subscription(subscription, loaned_message); +} + extern "C" rmw_ret_t rmw_take_event( const rmw_event_t * event_handle, void * event_info, bool * taken)