[vlc-commits] Revert "configure: Fix if_nametoindex detection"

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


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Dec  5 14:10:36 2017 +0100| [834c0a0b873ef41339440cafa46453a7f4734ab4] | committer: Hugo Beauzée-Luyssen

Revert "configure: Fix if_nametoindex detection"

This reverts commit 34d979557edd3f5ce8ef1e3dc1b4bbbf7d386327.
This only works for win64 since win32's stdcall will mangle the symbols

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

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

diff --git a/configure.ac b/configure.ac
index 4fb0e25f55..f9bde2aa4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -680,15 +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_SEARCH_LIBS([if_nametoindex], [iphlpapi], [
-  AS_IF([test "$ac_cv_search_if_nametoindex" != "none required"], [
-    SOCKET_LIBS="$ac_cv_search_if_nametoindex $SOCKET_LIBS"
-  ])
-  AC_DEFINE([HAVE_IF_NAMETOINDEX], [1], [Define to 1 if you have if_nametoindex function])
-])
-
-AC_CHECK_FUNCS([if_nameindex])
+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 54efe8a7d3..4888b782be 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -411,14 +411,13 @@ 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
 
-#ifndef HAVE_IF_NAMETOINDEX
-# define if_nametoindex(name)   atoi(name)
-#endif
-
 #ifndef HAVE_STRUCT_TIMESPEC
 struct timespec {
     time_t  tv_sec;   /* Seconds */
diff --git a/src/network/udp.c b/src/network/udp.c
index adc4376db9..d098fb1425 100644
--- a/src/network/udp.c
+++ b/src/network/udp.c
@@ -41,7 +41,6 @@
 #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