Closed wjwwood closed 7 years ago
Without this fix I get this when compiling:
Scanning dependencies of target rostime [ 25%] Building CXX object CMakeFiles/rostime.dir/src/duration.cpp.o [ 50%] Building CXX object CMakeFiles/rostime.dir/src/rate.cpp.o [ 75%] Building CXX object CMakeFiles/rostime.dir/src/time.cpp.o /tmp/test_ct/src/roscpp_core/rostime/src/time.cpp:178:19: error: use of undeclared identifier 'CLOCK_MONOTONIC' clock_gettime(CLOCK_MONOTONIC, &start); ^ 1 error generated. make[2]: *** [CMakeFiles/rostime.dir/src/time.cpp.o] Error 1 make[1]: *** [CMakeFiles/rostime.dir/all] Error 2 make: *** [all] Error 2
I think this is a regression from https://github.com/ros/roscpp_core/pull/57, but only for macOS (perhaps other BSD systems).
The SYSTEM_CLOCK when used with host_get_clock_service is the correct way to get a monotonic clock on macOS, despite "system clock" meaning something else in C++ and other lingo:
SYSTEM_CLOCK
host_get_clock_service
https://stackoverflow.com/a/11681069/671658
Without this fix I get this when compiling:
I think this is a regression from https://github.com/ros/roscpp_core/pull/57, but only for macOS (perhaps other BSD systems).
The
SYSTEM_CLOCK
when used withhost_get_clock_service
is the correct way to get a monotonic clock on macOS, despite "system clock" meaning something else in C++ and other lingo:https://stackoverflow.com/a/11681069/671658