diff --git a/include/polarssl/check_config.h b/include/polarssl/check_config.h index b44bcd5fb..e6df92f21 100644 --- a/include/polarssl/check_config.h +++ b/include/polarssl/check_config.h @@ -156,6 +156,10 @@ #error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" #endif +#if defined(POLARSSL_MEMORY_C) && !defined(POLARSSL_PLATFORM_C) +#error "POLARSSL_MEMORY_C defined, but not all prerequisites" +#endif + #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && \ ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) ) #error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" diff --git a/include/polarssl/config.h b/include/polarssl/config.h index 41ca1ab84..ad0cceb2b 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -1679,6 +1679,7 @@ /** * \def POLARSSL_MEMORY_C * Deprecated since 1.3.5. Please use POLARSSL_PLATFORM_MEMORY instead. + * Depends on: POLARSSL_PLATFORM_C */ //#define POLARSSL_MEMORY_C diff --git a/include/polarssl/memory.h b/include/polarssl/memory.h index 039740c12..986c0e768 100644 --- a/include/polarssl/memory.h +++ b/include/polarssl/memory.h @@ -32,10 +32,6 @@ #include -#if defined(POLARSSL_MEMORY_C) && !defined(POLARSSL_PLATFORM_MEMORY) -#define POLARSSL_PLATFORM_MEMORY -#endif - #include "platform.h" #include "memory_buffer_alloc.h" diff --git a/include/polarssl/platform.h b/include/polarssl/platform.h index 9e79b64df..f2d62630b 100644 --- a/include/polarssl/platform.h +++ b/include/polarssl/platform.h @@ -30,6 +30,11 @@ #include POLARSSL_CONFIG_FILE #endif +/* Temporary compability hack for to keep the deprecated MEMORY_C working */ +#if defined(POLARSSL_MEMORY_C) && !defined(POLARSSL_PLATFORM_MEMORY) +#define POLARSSL_PLATFORM_MEMORY +#endif + #include #ifdef __cplusplus