diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-02-24 15:45:31 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-02-24 15:45:31 +0000 |
commit | cc2c19c1643d08258141c7dfd47c814f68b3d3ce (patch) | |
tree | 2cc5a9b000c9c592937939c671ec86adb7693c4f /configure.ac | |
parent | ff04d7397a5cdfb41c8963d8f0d080529a6b1689 (diff) | |
download | dbus-cc2c19c1643d08258141c7dfd47c814f68b3d3ce.tar.gz |
Modernize checks for dirfd/dd_fd
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>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index b043018f..d895c3b4 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) |