From 2e401db31508cc9f7025eb1465e56d8c2e5a2544 Mon Sep 17 00:00:00 2001 From: pdmef Date: Wed, 5 Apr 2006 19:01:06 +0000 Subject: [PATCH] Rocco Rutte: - fix build on cygwin if struct dirent doesn't define d_ino git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@802 e385b8ad-14ed-0310-8656-cc95a2468c6d --- VERSION.svn | 2 +- configure.in | 11 ++++++++++- mh.c | 7 ++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/VERSION.svn b/VERSION.svn index 8bce69f..227b54a 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -801 +802 diff --git a/configure.in b/configure.in index 4ef4a1d..9921ab5 100644 --- a/configure.in +++ b/configure.in @@ -714,11 +714,20 @@ if test $mutt_cv_fcntl = yes; then AC_DEFINE(USE_FCNTL,1, [ Define to use fcntl() to lock folders. ]) fi +AC_MSG_CHECKING(whether struct dirent defines d_ino) +ac_cv_dirent_d_ino=no +AC_TRY_LINK([#include ],[struct dirent dp; (void)dp.d_ino],[ac_cv_dirent_d_ino=yes]) +if test x$ac_cv_dirent_d_ino = xyes ; then + AC_DEFINE(HAVE_DIRENT_D_INO,1, + [Define to 1 if your system has the dirent::d_ino member]) +fi +AC_MSG_RESULT($ac_cv_dirent_d_ino) + dnl This may look cumbersome -- please keep it that way, so we can dnl quickly change the default to "yes" again. mutt_cv_inodesort=no AC_ARG_ENABLE(inodesort, AC_HELP_STRING([--enable-inodesort], [Read files in maildir folders sorted by inode.]), - [if test x$enableval = xyes ; then mutt_cv_inodesort=yes; fi]) + [if test x$enableval = xyes -a x$ac_cv_dirent_d_ino = xyes ; then mutt_cv_inodesort=yes; fi]) if test $mutt_cv_inodesort = yes; then AC_DEFINE(USE_INODESORT, 1, [ Define to sort files in a maildir by inode number. ]) diff --git a/mh.c b/mh.c index ca13883..47231ed 100644 --- a/mh.c +++ b/mh.c @@ -703,7 +703,12 @@ static int maildir_parse_dir (CONTEXT * ctx, struct maildir ***last, debug_print (2, ("parsing %s\n", de->d_name)); maildir_parse_entry (ctx, last, subdir, de->d_name, count, is_old, - de->d_ino); +#if HAVE_DIRENT_D_INO + de->d_ino +#else + 0 +#endif + ); } closedir (dirp); -- 2.20.1