summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/src/pj/ip_helper_generic.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pjlib/src/pj/ip_helper_generic.c b/pjlib/src/pj/ip_helper_generic.c
index 7d4c6fc9..c9ece26d 100644
--- a/pjlib/src/pj/ip_helper_generic.c
+++ b/pjlib/src/pj/ip_helper_generic.c
@@ -52,7 +52,8 @@
#if 0
/* dummy */
-#elif defined(PJ_HAS_IFADDRS_H) && PJ_HAS_IFADDRS_H != 0
+#elif defined(PJ_HAS_IFADDRS_H) && PJ_HAS_IFADDRS_H != 0 && \
+ defined(PJ_HAS_NET_IF_H) && PJ_HAS_NET_IF_H != 0
/* Using getifaddrs() is preferred since it can work with both IPv4 and IPv6 */
static pj_status_t if_enum_by_af(int af,
unsigned *p_cnt,
@@ -108,7 +109,9 @@ static pj_status_t if_enum_by_af(int af,
return (*p_cnt != 0) ? PJ_SUCCESS : PJ_ENOTFOUND;
}
-#elif defined(SIOCGIFCONF)
+#elif defined(SIOCGIFCONF) && \
+ defined(PJ_HAS_NET_IF_H) && PJ_HAS_NET_IF_H != 0
+
/* Note: this does not work with IPv6 */
static pj_status_t if_enum_by_af(int af,
unsigned *p_cnt,