From f59b2e314ea6f7fd7e7b76320ea6dffd3b7dcd08 Mon Sep 17 00:00:00 2001 From: Janosch Machowinski Date: Mon, 20 Apr 2026 19:37:45 +0200 Subject: [PATCH] fix: Fixed MSVC compile errors (#3135) Signed-off-by: Janosch Machowinski Co-authored-by: Janosch Machowinski (cherry picked from commit 45aef033d432e6a66e5c84dd99a391fcbef0d567) Signed-off-by: Marco A. Gutierrez --- .../executors/events_cbg_executor/events_cbg_executor.hpp | 5 +++++ .../rclcpp/executors/events_cbg_executor/timer_manager.hpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp b/rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp index d0a36a673e..0da31a80c0 100644 --- a/rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp +++ b/rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp @@ -139,6 +139,7 @@ class EventsCBGExecutor : public rclcpp::Executor void spin(const std::function & exception_handler); + RCLCPP_PUBLIC void spin_once(std::chrono::nanoseconds timeout = std::chrono::nanoseconds(-1)) override; @@ -149,10 +150,12 @@ class EventsCBGExecutor : public rclcpp::Executor /** * @return true if work was available and executed */ + RCLCPP_PUBLIC bool collect_and_execute_ready_events( std::chrono::nanoseconds max_duration, bool recollect_if_no_work_available); + RCLCPP_PUBLIC void spin_all(std::chrono::nanoseconds max_duration) override; @@ -240,6 +243,7 @@ class EventsCBGExecutor : public rclcpp::Executor void run(size_t this_thread_number, bool block_initially); + RCLCPP_PUBLIC void run( size_t this_thread_number, @@ -290,6 +294,7 @@ class EventsCBGExecutor : public rclcpp::Executor */ void trigger_callback_group_sync(); + RCLCPP_PUBLIC void spin_once_internal(std::chrono::nanoseconds timeout); RCLCPP_DISABLE_COPY(EventsCBGExecutor) diff --git a/rclcpp/src/rclcpp/executors/events_cbg_executor/timer_manager.hpp b/rclcpp/src/rclcpp/executors/events_cbg_executor/timer_manager.hpp index eff95119c3..14bbccc00a 100644 --- a/rclcpp/src/rclcpp/executors/events_cbg_executor/timer_manager.hpp +++ b/rclcpp/src/rclcpp/executors/events_cbg_executor/timer_manager.hpp @@ -297,7 +297,7 @@ class TimerQueue */ bool remove_if_dropped(const TimerData * timer_data) { - if (timer_data->rcl_ref.unique()) { + if (timer_data->rcl_ref.use_count() == 1) { // clear on reset callback if(rcl_timer_set_on_reset_callback(timer_data->rcl_ref.get(), nullptr, nullptr) != RCL_RET_OK)