malloc: adjust memcpy() and memset() definitions.
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 10 Feb 2021 17:59:21 +0000 (18:59 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 24 Feb 2021 21:51:48 +0000 (16:51 -0500)
Compiling the sandbox fails on armv7 due to conflicting definitions of
memcpy() and memset() in include/malloc.h and include/linux/string.h.

Use linux/string.h here.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
include/malloc.h

index f66c2e8..e15e528 100644 (file)
@@ -361,8 +361,11 @@ extern "C" {
 #if (__STD_C || defined(HAVE_MEMCPY))
 
 #if __STD_C
+/* U-Boot defines memset() and memcpy in /include/linux/string.h
 void* memset(void*, int, size_t);
 void* memcpy(void*, const void*, size_t);
+*/
+#include <linux/string.h>
 #else
 #ifdef WIN32
 /* On Win32 platforms, 'memset()' and 'memcpy()' are already declared in */