]> git.sesse.net Git - vlc/commitdiff
Stub for if_nameindex()
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 13 Jun 2011 14:45:58 +0000 (17:45 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 13 Jun 2011 14:45:58 +0000 (17:45 +0300)
configure.ac
include/vlc_fixups.h
src/network/udp.c

index f7eeb3c8ed754b7f7f1401a5a2e6d06df683797b..b0000dc212b750477f0142dd358ebd0485f6fb3e 100644 (file)
@@ -566,7 +566,7 @@ dnl Check for system libs needed
 need_libc=false
 
 dnl Check for usual libc functions
-AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday isatty lstat memalign mmap openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp uselocale])
+AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday if_nameindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp uselocale])
 AC_REPLACE_FUNCS([asprintf atof atoll dirfd flockfile getcwd getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy vasprintf])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
index 63fcb2013ac9df7229e8787c5bc79b5f3bb89489..929ad07a1cdf41f2d61b52d863b536634e0091d6 100644 (file)
@@ -278,6 +278,17 @@ struct pollfd
 int vlc_poll (struct pollfd *, unsigned, int);
 #endif
 
+#ifndef HAVE_IF_NAMEINDEX
+struct if_nameindex
+{
+    unsigned if_index;
+    char    *if_name;
+};
+# define if_nametoindex(name)   atoi(name)
+# define if_nameindex()         (errno = ENOBUFS, NULL)
+# define if_freenameindex(list) (void)0
+#endif
+
 /* search.h */
 #ifndef HAVE_SEARCH_H
 typedef struct entry {
index 27813139453a286b92c101bbc57eff474e4b6aae..74217f8735cb95ff3e92e827b2790c14dd0f8d01 100644 (file)
@@ -45,7 +45,6 @@
 #       define IP_ADD_MEMBERSHIP 5
 #   endif
 #   define EAFNOSUPPORT WSAEAFNOSUPPORT
-#   define if_nametoindex( str ) atoi( str )
 #else
 #   include <unistd.h>
 #   ifdef HAVE_NET_IF_H
 #   endif
 #endif
 
-#ifdef __OS2__
-#   define if_nametoindex( str ) atoi( str )
-#endif
-
 #ifdef HAVE_LINUX_DCCP_H
 # include <linux/dccp.h>
 # ifndef SOCK_DCCP /* provisional API */