diff mbox series

[1/1] malloc: adjust memcpy() and memset() definitions.

Message ID 20210210175921.264801-1-xypron.glpk@gmx.de
State Accepted
Commit c6bf4f38988996f12c69a1cb5470bf9bea7c88ce
Delegated to: Tom Rini
Headers show
Series [1/1] malloc: adjust memcpy() and memset() definitions. | expand

Commit Message

Heinrich Schuchardt Feb. 10, 2021, 5:59 p.m. UTC
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>
---
 include/malloc.h | 3 +++
 1 file changed, 3 insertions(+)

--
2.30.0

Comments

Simon Glass Feb. 10, 2021, 9:34 p.m. UTC | #1
On Wed, 10 Feb 2021 at 10:59, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> 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>
> ---
>  include/malloc.h | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Feb. 25, 2021, 1:25 p.m. UTC | #2
On Wed, Feb 10, 2021 at 06:59:21PM +0100, Heinrich Schuchardt wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/include/malloc.h b/include/malloc.h
index f66c2e8617..e15e528a2e 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -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 */