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.
diff --git a/include/mbedtls/platform.h b/include/mbedtls/platform.h
index 82d5e33..212c267 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 @@
}
#endif
+#endif /* MBEDTLS_PLATFORM_C */
+
#endif /* platform.h */