From b4f98f3d1f902a15cb87bbb02a12112d52b15711 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Mon, 18 Dec 2017 13:24:54 +0900 Subject: [PATCH] Define macros for renaming xmalloc and xcalloc I'm planning to link strace with libiberty for mangling C++ symbol names in stack trace enabled with -k option. Both names, xmalloc and xcalloc, are already defined and used in libiberty, and they conflict with functions in strace. Rename xmalloc and xcalloc functions defined in strace to strace_xmalloc and strace_xcalloc, respectively, to avoid this conflict. * xmalloc.h (xcalloc, xmalloc): New macros. Signed-off-by: Masatake YAMATO --- xmalloc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xmalloc.h b/xmalloc.h index 66f2c366..43caa30f 100644 --- a/xmalloc.h +++ b/xmalloc.h @@ -36,6 +36,9 @@ #include #include "gcc_compat.h" +#define xcalloc strace_calloc +#define xmalloc strace_malloc + void *xcalloc(size_t nmemb, size_t size) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2)); void *xmalloc(size_t size) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1)); -- 2.40.0