From 79a7518fdd65d45927ce7d9c50523cdf08644b49 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Mon, 2 Jul 2018 11:32:57 +0200 Subject: [PATCH] Using inline functions for XMALLOC/XFREE/XREALLOC in contiki This is necessary to avoid the "unused variable" warnings --- wolfssl/wolfcrypt/settings.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 2f1c53cf4..a00c67552 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -229,6 +229,27 @@ #define SINGLE_THREADED #define WOLFSSL_USER_IO #define NO_FILESYSTEM + + static inline void* XREALLOC(void *p, size_t n, void* heap, int type) + { + (void)heap; + (void)type; + return realloc(p,n); + } + + static inline void *XMALLOC(size_t n, void* heap, int type) + { + (void)heap; + (void)type; + return malloc(n); + } + + static inline void XFREE(void *p, void* heap, int type) + { + (void)heap; + (void)type; + free(p); + } #endif #if defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_ROWLEY_ARM) @@ -516,6 +537,9 @@ #define NO_SESSION_CACHE #endif +#ifdef WOLFSSL_CONTIKI +#endif + /* Micrium will use Visual Studio for compilation but not the Win32 API */ #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \ !defined(FREERTOS_TCP) && !defined(EBSNET) && !defined(WOLFSSL_EROAD) && \