From fb9186a8f4f2ec7ded84f3455cd6dd5561d6703b Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 20 Aug 2024 19:56:03 -0500 Subject: [PATCH] wolfssl/wolfcrypt/error-crypt.h: add backward compatibility macro definitions for MP_ error codes. --- wolfssl/wolfcrypt/error-crypt.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wolfssl/wolfcrypt/error-crypt.h b/wolfssl/wolfcrypt/error-crypt.h index eb392fe72b..85e46b7dd8 100644 --- a/wolfssl/wolfcrypt/error-crypt.h +++ b/wolfssl/wolfcrypt/error-crypt.h @@ -338,6 +338,17 @@ WOLFSSL_ABI WOLFSSL_API const char* wc_GetErrorString(int error); #include #else #define WC_NO_ERR_TRACE(label) (label) + + /* historically, these MP_ error codes were macros. accommodate application + * code that tests if they're defined, or otherwise depends on them being + * macros. + */ + #ifndef BUILDING_WOLFSSL + #define MP_MEM MP_MEM + #define MP_VAL MP_VAL + #define MP_WOULDBLOCK MP_WOULDBLOCK + #define MP_NOT_INF MP_NOT_INF + #endif #endif #ifdef __cplusplus