aboutsummaryrefslogtreecommitdiff
blob: 2cc703fa4d536da20a36742eb3023a9e78997051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 6f6c844ab880d5535a05dd341643a28f7afeb6ec Mon Sep 17 00:00:00 2001
From: Jory Pratt <anarchy@gentoo.org>
Date: Wed, 3 Feb 2021 09:58:22 -0600
Subject: [PATCH] musl [added support for reallocarray](0), but the function
 prototype is declared in `stdlib.h` instead of `malloc.h`.

Update the check for reallocarray to check both in `malloc.h` and
`stdlib.h`.

[0]:https://git.musl-libc.org/cgit/musl/commit/?id=821083ac7b54eaa040d5a8ddc67c6206a175e0ca
---
 configure    | 2 +-
 configure.ac | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 40eed6c..4d12779 100755
--- a/configure
+++ b/configure
@@ -18252,7 +18252,7 @@ _ACEOF
 
 ac_fn_c_check_decl "$LINENO" "reallocarray" "ac_cv_have_decl_reallocarray" "
 #include <malloc.h>
-
+#include <stdlib.h>
 "
 if test "x$ac_cv_have_decl_reallocarray" = xyes; then :
   ac_have_decl=1
diff --git a/configure.ac b/configure.ac
index 0d448f3..bfc1972 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,7 @@ AC_CHECK_DECLS([
 	reallocarray],
 	[], [], [[
 #include <malloc.h>
+#include <stdlib.h>
 ]])
 
 AC_CHECK_DECLS([
-- 
2.26.2