[vlc-commits] Stub for if_nameindex()

Rémi Denis-Courmont git at videolan.org
Mon Jun 13 16:46:25 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jun 13 17:45:58 2011 +0300| [bfdbe1557034702b525a85aba49cea7aebfba3bd] | committer: Rémi Denis-Courmont

Stub for if_nameindex()

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

 configure.ac         |    2 +-
 include/vlc_fixups.h |   11 +++++++++++
 src/network/udp.c    |    5 -----
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index f7eeb3c..b0000dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.])
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 63fcb20..929ad07 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -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 {
diff --git a/src/network/udp.c b/src/network/udp.c
index 2781313..74217f8 100644
--- a/src/network/udp.c
+++ b/src/network/udp.c
@@ -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
@@ -53,10 +52,6 @@
 #   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 */



More information about the vlc-commits mailing list