From afb0b3971c8bbf0db03b76c605f3d5152d83a572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayd=C4=B1n=20Mercan?= Date: Thu, 4 Jan 2024 10:40:54 +0300 Subject: [PATCH] Forward declare mallocx in isc/mem.h cmocka.h and jemalloc.h/malloc_np.h has conflicting macro definitions. While fixing them with push_macro for only malloc is done below, we only need the non-standard mallocx interface which is easy to just define by ourselves. (cherry picked from commit 197de93bdc8eb5cc4dd18e0812cbb87c2ed7fa61) --- lib/isc/include/isc/mem.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/isc/include/isc/mem.h b/lib/isc/include/isc/mem.h index 3201ba4c8b..ab8dd2c2c0 100644 --- a/lib/isc/include/isc/mem.h +++ b/lib/isc/include/isc/mem.h @@ -190,7 +190,13 @@ extern unsigned int isc_mem_defaultflags; * for more information. */ #if HAVE_JEMALLOC -#include + +/* + * cmocka.h has confliction definitions with the jemalloc header but we only + * need the mallocx symbol from jemalloc. + */ +void * +mallocx(size_t size, int flags); extern volatile void *isc__mem_malloc;