From 0b8841202514399369e42ef26d75be24c6d4d306 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 12 Jul 2022 14:46:38 +0200 Subject: [PATCH] Fix build error with musl libc. --- include/smpi/smpi_helpers_internal.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/smpi/smpi_helpers_internal.h b/include/smpi/smpi_helpers_internal.h index 53ca8a710d..c089449dc3 100644 --- a/include/smpi/smpi_helpers_internal.h +++ b/include/smpi/smpi_helpers_internal.h @@ -16,6 +16,12 @@ #include #endif +#if !defined(SMPI_NO_OVERRIDE_MALLOC) && !defined(__GLIBC__) +/* For musl libc, must be included before #defining calloc(). Testing if !defined(__GLIBC__) is a bit crude + * but I don't know a better way. */ +#include +#endif + #ifdef __cplusplus extern "C" { #endif -- 2.20.1