Skip to content

Commit 32b94bd

Browse files
committed
time_unix: uses ZEPHYR_VERSION_CODE instead (ros2#390)
of KERNELVERSION, since zephyr from 2.7 does not use it anymore. Signed-off-by: Felipe Neves <[email protected]> Fix Signed-off-by: Pablo Garrido <[email protected]> Update Signed-off-by: Pablo Garrido <[email protected]>
1 parent e4aac4e commit 32b94bd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: src/time_unix.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ extern "C"
3030
#include <math.h>
3131

3232
#if defined(__ZEPHYR__)
33-
#include <posix/time.h> // Points to Zephyr toolchain posix time implementation
33+
#include <version.h>
34+
#if ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(3, 1, 0)
35+
#include <zephyr/posix/time.h> // Points to Zephyr toolchain posix time implementation
36+
#else
37+
#include <time.h>
38+
#endif // ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(3, 1, 0)
3439
#else
3540
#include <time.h>
3641
#endif // defined(__ZEPHYR__)

0 commit comments

Comments
 (0)