From e54bf98c3afc6dc6e6ce9496c217cb1c660aac4d Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:09:54 +0200 Subject: [PATCH] malloc.h: be a bit more consistent with macro definitions Currrently, malloc and free are function-like macros, while calloc, realloc and memalign are object-like macros. Usually, this doesn't matter, but it does when the identifiers appear without a following open parenthesis, such as when their address is taken for building the export table. Adding calloc or realloc to that table breaks the build on sandbox due to this inconsistency. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/malloc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/malloc.h b/include/malloc.h index 9e0be482416..3979fc62830 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -904,11 +904,11 @@ void *realloc_simple(void *ptr, size_t size); # define mALLOPt dlmallopt /* Ensure that U-Boot actually uses these too */ -#define calloc dlcalloc +#define calloc(x,y) dlcalloc(x,y) #define free(ptr) dlfree(ptr) #define malloc(x) dlmalloc(x) -#define memalign dlmemalign -#define realloc dlrealloc +#define memalign(a,x) dlmemalign(a,x) +#define realloc(p,x) dlrealloc(p,x) #define valloc dlvalloc #define pvalloc dlpvalloc #define mallinfo() dlmallinfo() -- 2.47.3