[vlc-devel] [PATCH] vlc_fixups: fix struct if_nameindex definition
Victorien Le Couviour--Tuffet
victorien.lecouviour.tuffet at gmail.com
Mon Oct 8 12:27:11 CEST 2018
Fixes android ndk17 build
---
configure.ac | 1 +
include/vlc_fixups.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/configure.ac b/configure.ac
index 09992925b7..202f1fa624 100644
--- a/configure.ac
+++ b/configure.ac
@@ -673,6 +673,7 @@ AC_LINK_IFELSE([
char dst[[sizeof(struct in_addr)]];
inet_pton(AF_INET, "127.0.0.1", dst);
])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
+AC_CHECK_TYPES([struct if_nameindex],,,[#include <net/if.h>])
AC_CHECK_FUNCS([if_nameindex])
VLC_RESTORE_FLAGS
AC_SUBST([SOCKET_LIBS])
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 037f67da31..87394fccad 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -413,11 +413,13 @@ int poll (struct pollfd *, unsigned, int);
#ifndef HAVE_IF_NAMEINDEX
#include <errno.h>
+# ifndef HAVE_STRUCT_IF_NAMEINDEX
struct if_nameindex
{
unsigned if_index;
char *if_name;
};
+# endif
# define if_nameindex() (errno = ENOBUFS, NULL)
# define if_freenameindex(list) (void)0
#endif
--
2.19.1
More information about the vlc-devel
mailing list