From 65be6b48dee73760fdee5213b74f3eab0ddfb7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 28 Nov 2019 12:51:45 +0100 Subject: [PATCH] Add compile guard in platform.h We may want to include it just for the errors it defines without having all of the other defines that only make sense when PLATFORM_C is enabled. --- include/mbedtls/platform.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/mbedtls/platform.h b/include/mbedtls/platform.h index 82d5e3355..212c26720 100644 --- a/include/mbedtls/platform.h +++ b/include/mbedtls/platform.h @@ -39,14 +39,16 @@ #include MBEDTLS_CONFIG_FILE #endif -#if defined(MBEDTLS_HAVE_TIME) -#include "platform_time.h" -#endif - #define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED -0x0070 /**< Hardware accelerator failed */ #define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED -0x0072 /**< The requested feature is not supported by the platform */ #define MBEDTLS_ERR_PLATFORM_FAULT_DETECTED -0x0071 /**< A fault was detected in a critical path, likely indicative of an active physical attack */ +#if defined(MBEDTLS_PLATFORM_C) + +#if defined(MBEDTLS_HAVE_TIME) +#include "platform_time.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -365,4 +367,6 @@ void mbedtls_platform_teardown( mbedtls_platform_context *ctx ); } #endif +#endif /* MBEDTLS_PLATFORM_C */ + #endif /* platform.h */