mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-11-21 12:40:51 +03:00
Move MBEDTLS_ERR_ADD macro and function to common.*
`error.c` is a file generated from `error.h` and thus cannot contain the code that was previously added. This commit fixes that issue by moving the `MBEDTLS_ERR_ADD` macro and associated function and function pointer into `common.h` and `common.c`. Also fix a typo in `tests/include/test/helpers.h` where tabs were accidentally used instead of spaces. Signed-off-by: Chris Jones <christopher.jones@arm.com>
This commit is contained in:
@@ -114,16 +114,6 @@ extern "C" {
|
||||
#define MBEDTLS_ERR_ERROR_GENERIC_ERROR -0x0001 /**< Generic error */
|
||||
#define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E /**< This is a bug in the library */
|
||||
|
||||
#if defined(MBEDTLS_TEST_HOOKS)
|
||||
void (*mbedtls_test_err_add_hook)( int, int, const char *, int );
|
||||
int mbedtls_err_add( int high, int low, const char *file, int line );
|
||||
#define MBEDTLS_ERR_ADD( high, low ) \
|
||||
( mbedtls_err_add( high, low, __FILE__, __LINE__ ) )
|
||||
#else
|
||||
#define MBEDTLS_ERR_ADD( high, low ) \
|
||||
( high + low )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Translate a mbed TLS error code into a string representation,
|
||||
* Result is truncated if necessary and always includes a terminating
|
||||
|
||||
Reference in New Issue
Block a user