From d56000a9f8d8d3d2d00435ba60fcfe4bd4191442 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Tue, 19 Mar 2024 07:48:48 +0100 Subject: [PATCH] Fix struct tm init --- .vscode/settings.json | 6 ++++++ include/rcutils/configuration_flags.h.in | 1 + src/time.c | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..74cd0b2a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.associations": { + "*.uml": "plantuml", + "*.in": "c" + } +} \ No newline at end of file diff --git a/include/rcutils/configuration_flags.h.in b/include/rcutils/configuration_flags.h.in index 346c6a33..ee58c1d3 100644 --- a/include/rcutils/configuration_flags.h.in +++ b/include/rcutils/configuration_flags.h.in @@ -10,6 +10,7 @@ extern "C" #cmakedefine RCUTILS_NO_FILESYSTEM #cmakedefine RCUTILS_AVOID_DYNAMIC_ALLOCATION #cmakedefine RCUTILS_NO_THREAD_SUPPORT +#cmakedefine RCUTILS_MICROROS #ifdef __cplusplus } diff --git a/src/time.c b/src/time.c index 882c9d98..f3e0cc67 100644 --- a/src/time.c +++ b/src/time.c @@ -52,6 +52,13 @@ rcutils_time_point_value_as_date_string( char * str, size_t str_size) { +#ifdef RCUTILS_MICROROS + (void)time_point; + (void)str; + (void)str_size; + + return RCUTILS_RET_ERROR; +#else RCUTILS_CHECK_ARGUMENT_FOR_NULL(time_point, RCUTILS_RET_INVALID_ARGUMENT); RCUTILS_CHECK_ARGUMENT_FOR_NULL(str, RCUTILS_RET_INVALID_ARGUMENT); if (0 == str_size) { @@ -99,6 +106,7 @@ rcutils_time_point_value_as_date_string( } return RCUTILS_RET_OK; +#endif // RCUTILS_MICROROS } rcutils_ret_t