From 60cfb78882a0adfcc025af2805c2d81e91be87d9 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Sun, 22 Feb 2026 20:40:10 +0100 Subject: [PATCH] Fix the build on non-Unix-like platforms that define CLOCK_REALTIME as a macro Needed for MinGW builds in our CI. Signed-off-by: Gilles Peskine --- tests/suites/test_suite_platform_unix.function | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/suites/test_suite_platform_unix.function b/tests/suites/test_suite_platform_unix.function index d731e07ed5..d9182bce74 100644 --- a/tests/suites/test_suite_platform_unix.function +++ b/tests/suites/test_suite_platform_unix.function @@ -17,8 +17,12 @@ #else /* defined(MBEDTLS_PLATFORM_IS_UNIXLIKE) */ /* Constants used in the test data need to be defined even if no test - * functions that use them are enabled. */ + * functions that use them are enabled. + * Undefine the macros first in case a system header does define them + * even though we haven't recognized the platform as Unix-like. */ +#undef CLOCK_REALTIME #define CLOCK_REALTIME 0 +#undef CLOCK_MONOTONIC #define CLOCK_MONOTONIC 0 #endif /* defined(MBEDTLS_PLATFORM_IS_UNIXLIKE) */