From f6727524c414c139212b474af36e029b344e1191 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Mon, 26 Aug 2019 08:51:03 +0200 Subject: [PATCH] removed stdlib.h inclusion from apps/malloc Attempt to fix #19 --- src/xmalloc.c | 5 ++++- test-app/app_hifive1.c | 1 - test-app/app_kinetis.c | 1 - test-app/app_nrf32.c | 1 - test-app/app_samr21.c | 1 - test-app/app_stm32f4.c | 1 - test-app/app_stm32f7.c | 1 - test-app/app_stm32g0.c | 1 - test-app/app_stm32l0.c | 1 - test-app/app_stm32wb.c | 1 - 10 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/xmalloc.c b/src/xmalloc.c index 15685109ff..d9505eb2e2 100644 --- a/src/xmalloc.c +++ b/src/xmalloc.c @@ -22,9 +22,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include +#ifndef NULL +# define NULL ((void *)(0)) +#endif + /* Allow one single sp_point to be allocated at one time */ #ifdef WOLFSSL_SP_ASM # define SP_POINT_SIZE (196) diff --git a/test-app/app_hifive1.c b/test-app/app_hifive1.c index 8cb9e89f83..9827437355 100644 --- a/test-app/app_hifive1.c +++ b/test-app/app_hifive1.c @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include #include #include "hal.h" diff --git a/test-app/app_kinetis.c b/test-app/app_kinetis.c index 3efc8ba334..2c0da708df 100644 --- a/test-app/app_kinetis.c +++ b/test-app/app_kinetis.c @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include #include #include "fsl_common.h" diff --git a/test-app/app_nrf32.c b/test-app/app_nrf32.c index dcc57e3816..628c05af79 100644 --- a/test-app/app_nrf32.c +++ b/test-app/app_nrf32.c @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include #include #include "wolfboot/wolfboot.h" diff --git a/test-app/app_samr21.c b/test-app/app_samr21.c index 8f4d99730e..4b5339b8db 100644 --- a/test-app/app_samr21.c +++ b/test-app/app_samr21.c @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include #include #include "hal.h" diff --git a/test-app/app_stm32f4.c b/test-app/app_stm32f4.c index 248b997d07..1a810e199f 100644 --- a/test-app/app_stm32f4.c +++ b/test-app/app_stm32f4.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include #include #include "system.h" diff --git a/test-app/app_stm32f7.c b/test-app/app_stm32f7.c index a2c0ced5dc..f06085922e 100644 --- a/test-app/app_stm32f7.c +++ b/test-app/app_stm32f7.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ #include -#include #include #include #include "system.h" diff --git a/test-app/app_stm32g0.c b/test-app/app_stm32g0.c index 94db25c08c..2559683f90 100644 --- a/test-app/app_stm32g0.c +++ b/test-app/app_stm32g0.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include #include #include "led.h" diff --git a/test-app/app_stm32l0.c b/test-app/app_stm32l0.c index 7b098b81f0..fe63155004 100644 --- a/test-app/app_stm32l0.c +++ b/test-app/app_stm32l0.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include #include #include "led.h" diff --git a/test-app/app_stm32wb.c b/test-app/app_stm32wb.c index c91f9dca9f..22e87cf13b 100644 --- a/test-app/app_stm32wb.c +++ b/test-app/app_stm32wb.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include #include #include #include "led.h"