Skip to content

Commit

Permalink
time_unix: uses ZEPHYR_VERSION_CODE instead (ros2#390)
Browse files Browse the repository at this point in the history
of KERNELVERSION, since zephyr from 2.7 does not use it anymore.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>

Fix

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

Update

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
  • Loading branch information
pablogs9 committed Apr 26, 2023
1 parent bc863ce commit 00229f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/time_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ extern "C"
#include <math.h>

#if defined(__ZEPHYR__)
#include <posix/time.h> // Points to Zephyr toolchain posix time implementation
#include <version.h>
#if ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(3, 1, 0)
#include <zephyr/posix/time.h> // Points to Zephyr toolchain posix time implementation
#else
#include <time.h>
#endif // ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(3, 1, 0)
#else
#include <time.h>
#endif // defined(__ZEPHYR__)
Expand Down

0 comments on commit 00229f3

Please sign in to comment.