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

KO Myung-Hun git at videolan.org
Mon Jan 8 11:28:07 CET 2018


vlc | branch: master | KO Myung-Hun <komh78 at gmail.com> | Mon Jan  1 23:30:02 2018 +0900| [ebcbb4d84e9207662d2bfc4e7fdf668d95caffd3] | committer: Hugo Beauzée-Luyssen

configure: check and define if_nametoindex() on OS/2

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
-----

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 configure.ac         | 1 +
 include/vlc_fixups.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index 9181f3854b..030832e3e3 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 */



More information about the vlc-commits mailing list