Skip to content

Commit e4aac4e

Browse files
Felipe Nevespablogs9
authored andcommitted
time_unix: add zephyr posix time (ros2#368)
own implementation allowing to fix error regarding CLOCK_MONOTONIC definition. Signed-off-by: Felipe <[email protected]>
1 parent acb6164 commit e4aac4e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/time_unix.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ extern "C"
2828
#include <mach/mach.h>
2929
#endif // defined(__MACH__)
3030
#include <math.h>
31+
32+
#if defined(__ZEPHYR__)
33+
#include <posix/time.h> // Points to Zephyr toolchain posix time implementation
34+
#else
3135
#include <time.h>
36+
#endif // defined(__ZEPHYR__)
3237
#include <unistd.h>
3338

3439
#include "./common.h"

0 commit comments

Comments
 (0)