Add missing guard to mbedtls_test_hook_error_add
Add a missing guard for the definition and declaration of
mbedtls_test_hook_error_add.
Also make the declaration always visible when MBEDTLS_TEST_HOOKS is
enabled. This fixes an issue when MBEDTLS_ERROR_C is not defined but
MBEDTLS_TEST_HOOKS is.
Signed-off-by: Chris Jones <christopher.jones@arm.com>
diff --git a/include/mbedtls/error.h b/include/mbedtls/error.h
index 6242289..49c3120 100644
--- a/include/mbedtls/error.h
+++ b/include/mbedtls/error.h
@@ -123,11 +123,13 @@
#define MBEDTLS_ERROR_ADD( high, low ) \
mbedtls_error_add_ext( high, low, __FILE__, __LINE__ )
+#if defined(MBEDTLS_TEST_HOOKS)
/**
* \brief Testing hook called before adding/combining two error codes together.
* Only used when invasive testing is enabled via MBEDTLS_TEST_HOOKS.
*/
extern void (*mbedtls_test_hook_error_add)( int, int, const char *, int );
+#endif
/**
* \brief Combines a high-level and low-level error code together.