Commit 34d97955 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

configure: Fix if_nametoindex detection

This fixes win32 builds
parent 30b6a669
......@@ -680,7 +680,15 @@ 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_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])
VLC_RESTORE_FLAGS
AC_SUBST(SOCKET_LIBS)
......
......@@ -411,13 +411,14 @@ 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 */
......
......@@ -41,6 +41,7 @@
#ifdef _WIN32
# undef EAFNOSUPPORT
# define EAFNOSUPPORT WSAEAFNOSUPPORT
# include <iphlpapi.h>
#else
# include <unistd.h>
# ifdef HAVE_NET_IF_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment