From eb82a74ed2b333386ab985e4d05329aef93a7c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 2 Apr 2014 13:43:48 +0200 Subject: [PATCH] Fix header issue with default malloc() --- include/polarssl/config.h | 2 ++ include/polarssl/platform.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/polarssl/config.h b/include/polarssl/config.h index decfc73ae..1681e1b4b 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -2040,6 +2040,8 @@ #define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ // Platform options +// +#define POLARSSL_PLATFORM_STD_MEM_HDR /**< Header to include for default allocator. Don't define if no header is needed. */ #define POLARSSL_PLATFORM_STD_MALLOC malloc /**< Default allocator to use, can be undefined */ #define POLARSSL_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */ #define POLARSSL_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ diff --git a/include/polarssl/platform.h b/include/polarssl/platform.h index b5dd4d144..a202ac15d 100644 --- a/include/polarssl/platform.h +++ b/include/polarssl/platform.h @@ -41,6 +41,10 @@ extern "C" { #define POLARSSL_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use */ #define POLARSSL_PLATFORM_STD_MALLOC malloc /**< Default allocator to use */ #define POLARSSL_PLATFORM_STD_FREE free /**< Default free to use */ +#else /* POLARSSL_CONFIG_OPTIONS */ +#if defined(POLARSSL_PLATFORM_STD_MEM_HDR) +#include POLARSSL_PLATFORM_STD_MEM_HDR +#endif #endif /* POLARSSL_CONFIG_OPTIONS */ /*