diff --git a/include/mbedtls/error.h b/include/mbedtls/error.h index 154f0718e3..5f2482284c 100644 --- a/include/mbedtls/error.h +++ b/include/mbedtls/error.h @@ -115,7 +115,7 @@ extern "C" { #define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E /**< This is a bug in the library */ -#if defined(MBEDTLS_TEST_HOOKS) +#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_ERROR_C) /** * \brief Set a function pointer (hook) to allow for invasive testing of error * code addition. diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function index 76e1057d14..7cae0da2b2 100644 --- a/tests/suites/main_test.function +++ b/tests/suites/main_test.function @@ -283,7 +283,7 @@ $platform_code */ int main( int argc, const char *argv[] ) { -#if defined(MBEDTLS_TEST_HOOKS) +#if defined(MBEDTLS_TEST_HOOKS) && defined (MBEDTLS_ERROR_C) mbedtls_set_err_add_hook( &mbedtls_test_err_add_check ); #endif