[windows] use macro to declare thread local storage
This commit is contained in:
parent
2a9b82bfba
commit
5a03ec1d0e
1 changed files with 3 additions and 1 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include <rmw/macros.h>
|
||||||
#include <rmw/rmw.h>
|
#include <rmw/rmw.h>
|
||||||
|
|
||||||
// Determine if sigaction is available
|
// Determine if sigaction is available
|
||||||
|
@ -89,7 +90,7 @@ namespace
|
||||||
namespace rclcpp
|
namespace rclcpp
|
||||||
{
|
{
|
||||||
|
|
||||||
__thread size_t thread_id = 0;
|
RMW_THREAD_LOCAL size_t thread_id = 0;
|
||||||
|
|
||||||
namespace utilities
|
namespace utilities
|
||||||
{
|
{
|
||||||
|
@ -115,6 +116,7 @@ init(int argc, char *argv[])
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
std::string("Failed to set SIGINT signal handler: (" +
|
std::string("Failed to set SIGINT signal handler: (" +
|
||||||
std::to_string(errno) + ")") +
|
std::to_string(errno) + ")") +
|
||||||
|
// TODO(wjwwood): use strerror_r on POSIX and strerror_s on Windows.
|
||||||
std::strerror(errno));
|
std::strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue