[vlc-commits] vlc_fixups: fix struct if_nameindex definition

Victorien Le Couviour--Tuffet git at videolan.org
Tue Oct 23 17:25:17 CEST 2018


vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Wed Sep 12 11:03:42 2018 +0200| [f844c78b272a8e7d4087aa972c9ff7767200c67c] | committer: Thomas Guillem

vlc_fixups: fix struct if_nameindex definition

Fixes android ndk17 build
(cherry picked from commit 0481899b5d17a18d33491f554a8957b63727d864)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f844c78b272a8e7d4087aa972c9ff7767200c67c
---

 configure.ac         | 1 +
 include/vlc_fixups.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index 54c270df37..007a2def19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -682,6 +682,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 if_nametoindex])
 VLC_RESTORE_FLAGS
 AC_SUBST(SOCKET_LIBS)
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 3003a154f6..286ff12ca6 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -412,11 +412,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
 # ifndef HAVE_IF_NAMETOINDEX
 #  define if_nametoindex(name)   atoi(name)
 # endif



More information about the vlc-commits mailing list