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
44
45
46
47
48
49
50
51
|
From 2ab442623e689532910b34ff0dbbc2167da02330 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 11 Jan 2017 17:39:07 -0600
Subject: [PATCH] fix musl compatibility (missing function prototypes)
inet_net_pton is already compiled, but no prototype is provided.
res_hnok is provided by the compatibility layer in libasr.
These fixes avoid warnings about implicit function declaration.
Fixes #758
---
configure.ac | 1 +
openbsd-compat/openbsd-compat.h | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/configure.ac b/configure.ac
index 42e092f..e27c514 100644
--- a/configure.ac
+++ b/configure.ac
@@ -594,6 +594,7 @@ AC_CHECK_FUNCS([ \
pledge \
pw_dup \
reallocarray \
+ res_hnok \
setenv \
setlinebuf \
setproctitle \
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index a51385b..5d2e2c2 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -208,10 +208,18 @@ void *reallocarray(void *, size_t, size_t);
void errc(int, int, const char *, ...);
#endif
+#ifndef HAVE_INET_NET_PTON
+int inet_net_pton(int, const char *, void *, size_t);
+#endif
+
#ifndef HAVE_PLEDGE
#define pledge(promises, paths) 0
#endif
+#ifndef HAVE_RES_HNOK
+int res_hnok(const char *);
+#endif
+
#if !HAVE_DECL_AF_LOCAL
#define AF_LOCAL AF_UNIX
#endif
|