Blame view

buildroot/buildroot-2016.08.1/package/owfs/0002-compat.h-only-include-compat_netdb.h-if-needed.patch 1.89 KB
6b13f685e   김민수   BSP 최초 추가
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
52
53
54
55
56
57
  From d24e63eea4f4d234f313145e40668a5e2f64e49c Mon Sep 17 00:00:00 2001
  From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
  Date: Wed, 9 Mar 2016 23:20:11 +0100
  Subject: [PATCH] compat.h: only include compat_netdb.h if needed
  
  compat_netdb.h is added for only one reason: to provide the definitions
  for getaddrinfo, in case it is not provided by the system.
  compat_netdb.h is just a copy from an old glibc version, but that makes
  it incompatible with other standard C libraries. For example, uClibc
  without RPC support doesn't have the rpc/netdb.h header. This leads to
  build errors.
  
  To work around this, only include compat_netdb.h when needed, i.e.
  when getaddrinfo isn't provided natively.
  
  Note that this getaddrinfo compat was introduced in commit bc54c431 to
  support Solaris 7. Starting from Solaris 8, however, getaddrinfo is
  available natively, and it's available on MacOS, Windows and any other
  POSIX-2001 compliant system as well. So it may be worhtwhile to remove
  it altogether.
  
  Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
  ---
   module/owlib/src/include/compat.h   | 2 ++
   module/ownet/c/src/include/compat.h | 2 ++
   2 files changed, 4 insertions(+)
  
  diff --git a/module/owlib/src/include/compat.h b/module/owlib/src/include/compat.h
  index c55bc96..e95e16f 100644
  --- a/module/owlib/src/include/compat.h
  +++ b/module/owlib/src/include/compat.h
  @@ -57,7 +57,9 @@
   #include <features.h>
   #endif
   
  +#ifndef HAVE_GETADDRINFO
   #include "compat_netdb.h"
  +#endif
   #include "compat_getopt.h"
   
   #ifndef HAVE_STRSEP
  diff --git a/module/ownet/c/src/include/compat.h b/module/ownet/c/src/include/compat.h
  index c45d852..f8ae759 100644
  --- a/module/ownet/c/src/include/compat.h
  +++ b/module/ownet/c/src/include/compat.h
  @@ -58,7 +58,9 @@ $Id$
   #include <features.h>
   #endif
   
  +#ifndef HAVE_GETADDRINFO
   #include "compat_netdb.h"
  +#endif
   #include "compat_getopt.h"
   
   #ifndef HAVE_STRSEP
  -- 
  2.7.0