nixpkgs/pkgs/by-name/li/librist/musl.patch
Alyssa Ross c81f064ea8
librist: fix build for musl
(cherry picked from commit 01fe6fb38d)
(cherry picked from commit 055e702400)
2024-11-30 15:11:08 +01:00

17 lines
650 B
Diff

diff --git a/test/rist/unit/srp_examples.c b/test/rist/unit/srp_examples.c
index 1c5193d..6f835b5 100644
--- a/test/rist/unit/srp_examples.c
+++ b/test/rist/unit/srp_examples.c
@@ -16,6 +16,11 @@
#define DEBUG_USE_EXAMPLE_CONSTANTS 1
#if HAVE_MBEDTLS
+// musl's sched.h includes a prototype for calloc, so we need to make
+// sure it's already been included before we redefine it to something
+// that won't expand to a valid prototype.
+#include <sched.h>
+
#define malloc(size) _test_malloc(size, __FILE__, __LINE__)
#define calloc(num, size) _test_calloc(num, size, __FILE__, __LINE__)
#define free(obj) _test_free(obj, __FILE__, __LINE__)