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 <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2026-02-22 20:40:10 +01:00
parent 9cd92b207f
commit 60cfb78882

View File

@@ -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) */