diff --git a/rclcpp/include/rclcpp/utilities.hpp b/rclcpp/include/rclcpp/utilities.hpp index 92cab04..1e03b19 100644 --- a/rclcpp/include/rclcpp/utilities.hpp +++ b/rclcpp/include/rclcpp/utilities.hpp @@ -27,6 +27,7 @@ #include #include +#include #include // Determine if sigaction is available @@ -89,7 +90,7 @@ namespace namespace rclcpp { -__thread size_t thread_id = 0; +RMW_THREAD_LOCAL size_t thread_id = 0; namespace utilities { @@ -115,6 +116,7 @@ init(int argc, char *argv[]) throw std::runtime_error( std::string("Failed to set SIGINT signal handler: (" + std::to_string(errno) + ")") + + // TODO(wjwwood): use strerror_r on POSIX and strerror_s on Windows. std::strerror(errno)); } }