Repository navigation
Conversation
|
Thanks @esteve, we currently don't use the CMAKE_X_STANDARD but that would be a great improvement and more platform/compiler agnostic way to do in every package rather than passing |
| // Some other non-Windows, non-cygwin, non-apple OS | ||
| #define RCUTILS_THREAD_LOCAL _Thread_local | ||
| #if __STDC_VERSION__ >= 201112L | ||
| // C11 enabled |
There was a problem hiding this comment.
Please move this comment at the end of the previous line (or indent it to the level of the current block).
There was a problem hiding this comment.
How so? Doesn't this follow the same style as https://github.com/ros2/rcutils/blob/master/include/rcutils/macros.h#L32 https://github.com/ros2/rcutils/blob/master/include/rcutils/macros.h#L35 et al?
| endif() | ||
|
|
||
| if(NOT WIN32) | ||
| add_definitions(-D_POSIX_C_SOURCE=199309L) |
There was a problem hiding this comment.
This was needed for clock_gettime, but only if std=c99 was used instead. CMAKE_C_STANDARD already causes CMake to set the appropriate flags so _POSIX_C_SOURCE is not needed
Edit: I removed this define in bf792e5
|
I just rebased this to resolve any potential conflicts, let me know if there's any further work that needs to be done. |
|
Thanks @esteve ! I'm trying out the same logic on every package and will run CI with all of them including your branches on rmw and rcl |
|
@mikaelarguedas no problem, great idea to use |
|
Please see #36 for switching to use C11. |
|
@esteve would you mind changing this one to C11 as well ? It proved to generate warnings on OSX because of the new variadic logging macros. thanks! |
|
@mikaelarguedas done, I've pushed 4224fa1 to switch to C11 |
mikaelarguedas
left a comment
There was a problem hiding this comment.
lgtm, @dirk-thomas do you want to push style fixup to this before merging ?
| #define RCUTILS_THREAD_LOCAL _Thread_local | ||
| #else | ||
| #define RCUTILS_THREAD_LOCAL __thread | ||
| #endif |
There was a problem hiding this comment.
Do we still need / want to keep this with C11 being selected? I would be in favor or removing the change and keeping it as-is.
There was a problem hiding this comment.
I think it's safe to remove this given that C11 will be selected by default from now on
There was a problem hiding this comment.
The remaining patch is already part of #35. Should we close this than?
|
@dirk-thomas no problem, happy to see this getting merged one way or another :-) |
The version of C standard wasn't explicit, so I added
CMAKE_C_STANDARDand set it to 99 (if I'm not mistaken that's the version that ROS2 is targeting).I also added some logic that enables switching to C11 to enable
_Thread_localinstead of__thread