From c8d45cd3fc499b6f1a544ba8786678e6f597d30f Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 29 May 2024 09:34:20 +0200 Subject: [PATCH] Error on unexpectedly defined symbols Signed-off-by: Gilles Peskine --- include/mbedtls/build_info.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/mbedtls/build_info.h b/include/mbedtls/build_info.h index e13e236d45..cf38f90981 100644 --- a/include/mbedtls/build_info.h +++ b/include/mbedtls/build_info.h @@ -101,8 +101,12 @@ #define inline __inline #endif -#undef MBEDTLS_CONFIG_FILES_READ -#undef MBEDTLS_CONFIG_IS_FINALIZED +#if defined(MBEDTLS_CONFIG_FILES_READ) +#error "Something went wrong: MBEDTLS_CONFIG_FILES_READ defined before reading the config files!" +#endif +#if defined(MBEDTLS_CONFIG_IS_FINALIZED) +#error "Something went wrong: MBEDTLS_CONFIG_IS_FINALIZED defined before reading the config files!" +#endif /* X.509, TLS and non-PSA crypto configuration */ #if !defined(MBEDTLS_CONFIG_FILE)