Conversation
Signed-off-by: Adam Aposhian <adam.aposhian@fireflyautomatix.com>
src/thread_name.cpp
Outdated
|
|
||
| // This includes the null terminator | ||
| #if defined(__APPLE__) | ||
| constexpr size_t MAXTHREADNAMESIZE = 64; |
There was a problem hiding this comment.
- add include for size_t
src/thread_name.cpp
Outdated
| std::error_code error_code(result, std::system_category()); | ||
| throw std::system_error(error_code, "Failed to get thread name"); | ||
| } | ||
| std::wstringstream wss; |
There was a problem hiding this comment.
It is included, but only on windows.
|
|
||
| std::string get_thread_name() | ||
| { | ||
| std::string name; |
There was a problem hiding this comment.
- add string include to cpp
Signed-off-by: Adam Aposhian <adam.aposhian@fireflyautomatix.com>
Signed-off-by: Adam Aposhian <adam.aposhian@fireflyautomatix.com>
Signed-off-by: Adam Aposhian <adam.aposhian@fireflyautomatix.com>
230621f to
2a2a955
Compare
Signed-off-by: Adam Aposhian <adam.aposhian@fireflyautomatix.com>
|
I finally got my Windows development environment up, so I was able to test, and now this compiles and tests pass on Windows. I have still not tested on Apple |
|
Pulls: #213, ros2/rclcpp#2871 |
There was a problem hiding this comment.
Windows is failing
test_thread_name.obj : error LNK2019: unresolved external symbol "void __cdecl rcpputils::set_thread_name(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?set_thread_name@rcpputils@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: virtual void __cdecl TestOsThread_set_thread_name_Test::TestBody(void)" (?TestBody@TestOsThread_set_thread_name_Test@@EEAAXXZ) [C:\ci\ws\build\rcpputils\test_thread_name.vcxproj]
test_thread_name.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl rcpputils::get_thread_name(void)" (?get_thread_name@rcpputils@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "private: virtual void __cdecl TestOsThread_set_thread_name_Test::TestBody(void)" (?TestBody@TestOsThread_set_thread_name_Test@@EEAAXXZ) [C:\ci\ws\build\rcpputils\test_thread_name.vcxproj]
uncrustify is also failing
Signed-off-by: Adam Aposhian <adam.aposhian@fireflyautomatix.com>
Signed-off-by: Adam Aposhian <adam.aposhian@fireflyautomatix.com>
|
Ok I believe the windows build should be fixed now. My Windows build environment is a bit of a mess, so I wasn't replicating the build settings that ament and colcon use correctly. |
|
Pulls: ros2/rclcpp#2871, #213 |
fujitatomoya
left a comment
There was a problem hiding this comment.
@Aposhian sorry for being late to get back to you since i was on vacation last week. and thanks for moving the function to rcpputils. already merged, lgtm anyway.
Description
Moved thread naming utilities from ros2/rclcpp#2871.
Fixes ros2/rclcpp#2818
Is this user-facing behavior change?
No, just new interfaces.
Did you use Generative AI?
Yes. Cursor autocomplete.
Additional Information