[vlc-commits] configure: Assume if_nametoindex to be present

Hugo Beauzée-Luyssen git at videolan.org
Tue Dec 5 18:38:53 CET 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Dec  5 18:39:42 2017 +0100| [c0bf5aeefc611f8d1e1ace6111c88956c0a8fa6c] | committer: Hugo Beauzée-Luyssen

configure: Assume if_nametoindex to be present

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

 configure.ac         | 4 ++--
 include/vlc_fixups.h | 3 ---
 src/network/udp.c    | 1 +
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index f9bde2aa4c..1e877069f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -656,7 +656,7 @@ AC_SEARCH_LIBS(connect, [socket], [
   ])
 ], [
   AS_IF([test "${SYS}" = "mingw32"], [
-    SOCKET_LIBS="-lws2_32"
+    SOCKET_LIBS="-lws2_32 -liphlpapi"
   ])
 ])
 
@@ -680,7 +680,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_FUNCS([if_nameindex if_nametoindex])
+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 4888b782be..6175a539bd 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -411,9 +411,6 @@ struct if_nameindex
     unsigned if_index;
     char    *if_name;
 };
-# ifndef HAVE_IF_NAMETOINDEX
-#  define if_nametoindex(name)   atoi(name)
-# endif
 # define if_nameindex()         (errno = ENOBUFS, NULL)
 # define if_freenameindex(list) (void)0
 #endif
diff --git a/src/network/udp.c b/src/network/udp.c
index d098fb1425..adc4376db9 100644
--- a/src/network/udp.c
+++ b/src/network/udp.c
@@ -41,6 +41,7 @@
 #ifdef _WIN32
 #   undef EAFNOSUPPORT
 #   define EAFNOSUPPORT WSAEAFNOSUPPORT
+#   include <iphlpapi.h>
 #else
 #   include <unistd.h>
 #   ifdef HAVE_NET_IF_H



More information about the vlc-commits mailing list