[vlc-devel] [PATCH] configure: check and define if_nametoindex() on OS/2

KO Myung-Hun komh78 at gmail.com
Mon Jan 1 15:30:02 CET 2018


This fixes the following compilation breakge on OS/2.

-----
  CC       network/udp.lo
network/udp.c: In function 'net_SetMcastOut':
network/udp.c:259:17: error: implicit declaration of function 'if_nametoindex'; did you mean 'if_nameindex'? [-Werror=implicit-function-declaration]
     int scope = if_nametoindex (iface);
                 ^~~~~~~~~~~~~~
                 if_nameindex
-----
---
 configure.ac         | 1 +
 include/vlc_fixups.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index 9c37d78caf..c95ca2757e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -290,6 +290,7 @@ case "${host_os}" in
     LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
     AC_LIBOBJ([freeaddrinfo])
     AC_LIBOBJ([gai_strerror])
+    AC_CHECK_FUNCS([if_nametoindex])
     ;;
   *nacl*)
     SYS=nacl
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 6175a539bd..0791aba4d6 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -602,6 +602,10 @@ static const struct in6_addr in6addr_any =
 # ifndef EPROTO
 #  define EPROTO (ELAST + 1)
 # endif
+
+# ifndef HAVE_IF_NAMETOINDEX
+#  define if_nametoindex(name)  atoi(name)
+# endif
 #endif
 
 /* math.h */
-- 
2.13.3



More information about the vlc-devel mailing list