[vlc-devel] [PATCH 2/4] Test for if_nameindex in a specific header.

Maciej Blizinski maciej at opencsw.org
Wed Feb 29 10:48:27 CET 2012


On Solaris 10, if_nameindex is defined in a specific header file which needs
to be included. When testing for if_nameindex, the header is now used and the
false negative is removed.
---
 configure.ac         |    3 ++-
 include/vlc_fixups.h |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6ce41f5..0eb47d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -490,8 +490,9 @@ need_libc=false
 
 dnl Check for usual libc functions
 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
-AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
+AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
+AC_CHECK_DECLS([if_nameindex],,,[#include <net/if.h>])
 AC_CHECK_DECLS([O_DIRECTORY])
 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 9b6ac21..98d77ac 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -283,7 +283,7 @@ struct pollfd;
 int poll (struct pollfd *, unsigned, int);
 #endif
 
-#ifndef HAVE_IF_NAMEINDEX
+#ifndef HAVE_DECL_IF_NAMEINDEX
 #include <errno.h>
 struct if_nameindex
 {
-- 
1.7.9




More information about the vlc-devel mailing list