From 83942bb0cb3f2ff1a43e37bc34534f5b3d1ebbfe Mon Sep 17 00:00:00 2001 From: nauta Date: Fri, 10 May 2024 21:09:02 +0800 Subject: [PATCH] fix build --- src/alloc-override.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/alloc-override.c b/src/alloc-override.c index 75afc202..86bdfb92 100644 --- a/src/alloc-override.c +++ b/src/alloc-override.c @@ -136,6 +136,9 @@ typedef void* mi_nothrow_t; mi_decl_export void* realloc(void* p, size_t newsize) MI_FORWARD2(mi_realloc, p, newsize) mi_decl_export void free(void* p) MI_FORWARD0(mi_free, p) // In principle we do not need to forward `strdup`/`strndup` but on some systems these do not use `malloc` internally (but a more primitive call) + #if defined(strdup) + #undef strdup + #endif mi_decl_export char* strdup(const char* str) MI_FORWARD1(mi_strdup, str) #if !defined(__APPLE__) || (defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) mi_decl_export char* strndup(const char* str, size_t n) MI_FORWARD2(mi_strndup, str, n)