Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From c6c5966d9fae27bc2f0a34ab59b999555111bd2d Mon Sep 17 00:00:00 2001 |
| 2 | From: Aric Belsito <lluixhi@gmail.com> |
| 3 | Date: Sun, 29 Oct 2017 23:17:03 +0100 |
| 4 | Subject: [PATCH] Fix build on MUSL |
| 5 | |
| 6 | Add missing AI_IDN and NI_IDN declarations. |
| 7 | |
| 8 | Bug: https://bugs.gentoo.org/503914 |
| 9 | |
| 10 | Upstream-Status: Pending |
| 11 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 12 | --- |
| 13 | arping.c | 7 +++++++ |
| 14 | ping.h | 11 +++++++++++ |
| 15 | tracepath.c | 8 ++++++++ |
| 16 | traceroute6.c | 4 ++++ |
| 17 | 4 files changed, 30 insertions(+) |
| 18 | |
| 19 | diff --git a/arping.c b/arping.c |
| 20 | index 1a3f40b..531d29d 100644 |
| 21 | --- a/arping.c |
| 22 | +++ b/arping.c |
| 23 | @@ -45,6 +45,13 @@ struct sysfs_devattr_values; |
| 24 | #ifdef USE_IDN |
| 25 | #include <idna.h> |
| 26 | #include <locale.h> |
| 27 | + |
| 28 | +#ifndef AI_IDN |
| 29 | +#define AI_IDN 0x0040 |
| 30 | +#endif |
| 31 | +#ifndef AI_CANONIDN |
| 32 | +#define AI_CANONIDN 0x0080 |
| 33 | +#endif |
| 34 | #endif |
| 35 | |
| 36 | #include "SNAPSHOT.h" |
| 37 | diff --git a/ping.h b/ping.h |
| 38 | index 749f3ff..227315f 100644 |
| 39 | --- a/ping.h |
| 40 | +++ b/ping.h |
| 41 | @@ -38,6 +38,17 @@ |
| 42 | #include <locale.h> |
| 43 | #include <idna.h> |
| 44 | #include <stringprep.h> |
| 45 | + |
| 46 | +#ifndef AI_IDN |
| 47 | +#define AI_IDN 0x0040 |
| 48 | +#endif |
| 49 | +#ifndef AI_CANONIDN |
| 50 | +#define AI_CANONIDN 0x0080 |
| 51 | +#endif |
| 52 | +#ifndef NI_IDN |
| 53 | +#define NI_IDN 32 |
| 54 | +#endif |
| 55 | + |
| 56 | #define getaddrinfo_flags (AI_CANONNAME | AI_IDN | AI_CANONIDN) |
| 57 | #define getnameinfo_flags NI_IDN |
| 58 | #else |
| 59 | diff --git a/tracepath.c b/tracepath.c |
| 60 | index 74a829d..dcec5b9 100644 |
| 61 | --- a/tracepath.c |
| 62 | +++ b/tracepath.c |
| 63 | @@ -30,6 +30,14 @@ |
| 64 | #ifdef USE_IDN |
| 65 | #include <idna.h> |
| 66 | #include <locale.h> |
| 67 | + |
| 68 | +#ifndef AI_IDN |
| 69 | +#define AI_IDN 0x0040 |
| 70 | +#endif |
| 71 | +#ifndef NI_IDN |
| 72 | +#define NI_IDN 32 |
| 73 | +#endif |
| 74 | + |
| 75 | #define getnameinfo_flags NI_IDN |
| 76 | #else |
| 77 | #define getnameinfo_flags 0 |
| 78 | diff --git a/traceroute6.c b/traceroute6.c |
| 79 | index 48fc5c5..8d1eebf 100644 |
| 80 | --- a/traceroute6.c |
| 81 | +++ b/traceroute6.c |
| 82 | @@ -251,6 +251,10 @@ |
| 83 | #include <idna.h> |
| 84 | #include <locale.h> |
| 85 | |
| 86 | +#ifndef NI_IDN |
| 87 | +#define NI_IDN 32 |
| 88 | +#endif |
| 89 | + |
| 90 | #define getnameinfo_flags NI_IDN |
| 91 | #else |
| 92 | #define getnameinfo_flags 0 |
| 93 | -- |
| 94 | 2.15.1 |
| 95 | |