From 9cd92b207fe9bdfead66d96cb020946a0849e9db Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Sat, 21 Feb 2026 21:18:03 +0100 Subject: [PATCH] Support testing baremetal builds without the UNIXLIKE code When `MBEDTLS_TEST_PLATFORM_IS_NOT_UNIXLIKE` is defined, do not enable `MBEDTLS_PLATFORM_IS_UNIXLIKE`. This lets us test baremetal builds as such even if we happen to be building for Linux or other Unix-like platform. Signed-off-by: Gilles Peskine --- library/common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/common.h b/library/common.h index 4aab94ba21..1f59b32426 100644 --- a/library/common.h +++ b/library/common.h @@ -29,7 +29,10 @@ /* Decide whether we're built for a Unix-like platform. */ -#if defined(_WIN32) +#if defined(MBEDTLS_TEST_PLATFORM_IS_NOT_UNIXLIKE) //no-check-names +/* We may be building on a Unix-like platform, but for test purposes, + * do not try to use Unix features. */ +#elif defined(_WIN32) /* If Windows platform interfaces are available, we use them, even if * a Unix-like might also to be available. */ /* defined(_WIN32) ==> we can include */