dtc: update legal info
[buildroot-gz.git] / package / owfs / 0002-compat.h-only-include-compat_netdb.h-if-needed.patch
blob7ae79325f4a31694ecf5804f544f6e68e7eeaf20
1 From d24e63eea4f4d234f313145e40668a5e2f64e49c Mon Sep 17 00:00:00 2001
2 From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
3 Date: Wed, 9 Mar 2016 23:20:11 +0100
4 Subject: [PATCH] compat.h: only include compat_netdb.h if needed
6 compat_netdb.h is added for only one reason: to provide the definitions
7 for getaddrinfo, in case it is not provided by the system.
8 compat_netdb.h is just a copy from an old glibc version, but that makes
9 it incompatible with other standard C libraries. For example, uClibc
10 without RPC support doesn't have the rpc/netdb.h header. This leads to
11 build errors.
13 To work around this, only include compat_netdb.h when needed, i.e.
14 when getaddrinfo isn't provided natively.
16 Note that this getaddrinfo compat was introduced in commit bc54c431 to
17 support Solaris 7. Starting from Solaris 8, however, getaddrinfo is
18 available natively, and it's available on MacOS, Windows and any other
19 POSIX-2001 compliant system as well. So it may be worhtwhile to remove
20 it altogether.
22 Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
23 ---
24 module/owlib/src/include/compat.h | 2 ++
25 module/ownet/c/src/include/compat.h | 2 ++
26 2 files changed, 4 insertions(+)
28 diff --git a/module/owlib/src/include/compat.h b/module/owlib/src/include/compat.h
29 index c55bc96..e95e16f 100644
30 --- a/module/owlib/src/include/compat.h
31 +++ b/module/owlib/src/include/compat.h
32 @@ -57,7 +57,9 @@
33 #include <features.h>
34 #endif
36 +#ifndef HAVE_GETADDRINFO
37 #include "compat_netdb.h"
38 +#endif
39 #include "compat_getopt.h"
41 #ifndef HAVE_STRSEP
42 diff --git a/module/ownet/c/src/include/compat.h b/module/ownet/c/src/include/compat.h
43 index c45d852..f8ae759 100644
44 --- a/module/ownet/c/src/include/compat.h
45 +++ b/module/ownet/c/src/include/compat.h
46 @@ -58,7 +58,9 @@ $Id$
47 #include <features.h>
48 #endif
50 +#ifndef HAVE_GETADDRINFO
51 #include "compat_netdb.h"
52 +#endif
53 #include "compat_getopt.h"
55 #ifndef HAVE_STRSEP
56 --
57 2.7.0