[vlc-commits] vlc_fixups: fix struct if_nameindex definition
Victorien Le Couviour--Tuffet
git at videolan.org
Tue Oct 23 14:53:58 CEST 2018
vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Wed Sep 12 11:03:42 2018 +0200| [0481899b5d17a18d33491f554a8957b63727d864] | committer: Thomas Guillem
vlc_fixups: fix struct if_nameindex definition
Fixes android ndk17 build
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0481899b5d17a18d33491f554a8957b63727d864
---
configure.ac | 1 +
include/vlc_fixups.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/configure.ac b/configure.ac
index 054d3d69d4..9066dd7022 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
More information about the vlc-commits
mailing list