aboutsummaryrefslogtreecommitdiffstats
path: root/package/libglib2/libglib2-optional-ipv6.patch
blob: 7c511a312aec10c334385adb8ac28adf54a8b2f7 (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
44
45
46
47
48
49
50
51
52
53
[PATCH]: fix build on uClibc without IPv6 support

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 gio/ginetaddress.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: glib-2.22.4/gio/ginetaddress.c
===================================================================
--- glib-2.22.4.orig/gio/ginetaddress.c
+++ glib-2.22.4/gio/ginetaddress.c
@@ -21,6 +21,7 @@
  *          Samuel Cormier-Iijima <sciyoshi@gmail.com>
  */
 
+#include <features.h>
 #include <config.h>
 
 #include <string.h>
@@ -435,7 +436,11 @@ g_inet_address_new_from_string (const gc
   return NULL;
 }
 
+#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_IPV6__)
+#define G_INET_ADDRESS_FAMILY_IS_VALID(family) ((family) == AF_INET)
+#else
 #define G_INET_ADDRESS_FAMILY_IS_VALID(family) ((family) == AF_INET || (family) == AF_INET6)
+#endif
 
 /**
  * g_inet_address_new_from_bytes:
@@ -484,8 +489,10 @@ g_inet_address_new_loopback (GSocketFami
 
       return g_inet_address_new_from_bytes (addr, family);
     }
+#if !(defined(__UCLIBC__) && !defined(__UCLIBC_HAS_IPV6__))
   else
     return g_inet_address_new_from_bytes (in6addr_loopback.s6_addr, family);
+#endif
 }
 
 /**
@@ -511,8 +518,10 @@ g_inet_address_new_any (GSocketFamily fa
 
       return g_inet_address_new_from_bytes (addr, family);
     }
+#if !(defined(__UCLIBC__) && !defined(__UCLIBC_HAS_IPV6__))
   else
     return g_inet_address_new_from_bytes (in6addr_any.s6_addr, family);
+#endif
 }