From a7f8033fa45079da6e95f17d0fe9df8dedc7dc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 27 May 2015 20:26:40 +0200 Subject: [PATCH] Fix oversights in s/malloc/calloc/ --- include/mbedtls/check_config.h | 26 +++++++++++++------------- include/mbedtls/compat-1.3.h | 3 --- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index c414490db..df222ce7b 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -229,22 +229,22 @@ #error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" #endif -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_MALLOC_MACRO) -#error "MBEDTLS_PLATFORM_MALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" +#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) +#error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" #endif -#if defined(MBEDTLS_PLATFORM_MALLOC_MACRO) &&\ +#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_MALLOC_MACRO defined, but not all prerequisites" +#error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" #endif -#if defined(MBEDTLS_PLATFORM_MALLOC_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_MALLOC) -#error "MBEDTLS_PLATFORM_MALLOC_MACRO and MBEDTLS_PLATFORM_STD_MALLOC cannot be defined simultaneously" +#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ + defined(MBEDTLS_PLATFORM_STD_CALLOC) +#error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" #endif -#if defined(MBEDTLS_PLATFORM_MALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) -#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_MALLOC_MACRO is" +#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) +#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" #endif #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) @@ -289,12 +289,12 @@ #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" #endif -#if defined(MBEDTLS_PLATFORM_STD_MALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_MALLOC defined, but not all prerequisites" +#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) +#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" #endif -#if defined(MBEDTLS_PLATFORM_STD_MALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_MALLOC defined, but not all prerequisites" +#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) +#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" #endif #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) diff --git a/include/mbedtls/compat-1.3.h b/include/mbedtls/compat-1.3.h index 117312954..76d504bb7 100644 --- a/include/mbedtls/compat-1.3.h +++ b/include/mbedtls/compat-1.3.h @@ -414,9 +414,6 @@ #if defined MBEDTLS_PLATFORM_FREE_MACRO #define POLARSSL_PLATFORM_FREE_MACRO MBEDTLS_PLATFORM_FREE_MACRO #endif -#if defined MBEDTLS_PLATFORM_MALLOC_MACRO -#define POLARSSL_PLATFORM_MALLOC_MACRO MBEDTLS_PLATFORM_MALLOC_MACRO -#endif #if defined MBEDTLS_PLATFORM_MEMORY #define POLARSSL_PLATFORM_MEMORY MBEDTLS_PLATFORM_MEMORY #endif