Modernize checks for dirfd/dd_fd
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 24 Feb 2011 15:45:31 +0000 (15:45 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 24 Feb 2011 15:45:31 +0000 (15:45 +0000)
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
configure.ac

index b043018..d895c3b 100644 (file)
@@ -491,32 +491,34 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 AC_MSG_RESULT($broken_poll)
 
 AC_MSG_CHECKING(for dirfd)
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #include <dirent.h>
-],[
+]], [[
 DIR *dirp;
 dirp = opendir(".");
 dirfd(dirp);
 closedir(dirp);
-],
-dbus_have_dirfd=yes, dbus_have_dirfd=no)
+]])],
+[dbus_have_dirfd=yes],
+[dbus_have_dirfd=no])
 AC_MSG_RESULT($dbus_have_dirfd)
 if test "$dbus_have_dirfd" = yes; then
        AC_DEFINE(HAVE_DIRFD,1,[Have dirfd function])
 else
        AC_MSG_CHECKING(for DIR *dirp->dd_fd)
-       AC_TRY_LINK([
+       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #include <dirent.h>
-       ],[
+       ]], [[
 DIR *dirp;
 int fd;
 dirp = opendir(".");
 fd = dirp->dd_fd;
 closedir(dirp);
-       ],
-       dbus_have_ddfd=yes, dbus_have_ddfd=no)
+        ]])],
+        [dbus_have_ddfd=yes],
+        [dbus_have_ddfd=no])
        AC_MSG_RESULT($dbus_have_ddfd)
        if test "$dbus_have_ddfd" = yes; then
                AC_DEFINE(HAVE_DDFD,1,[Have the ddfd member of DIR])