Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Wed, 5 Apr 2006 19:01:06 +0000 (19:01 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Wed, 5 Apr 2006 19:01:06 +0000 (19:01 +0000)
- 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
configure.in
mh.c

index 8bce69f..227b54a 100644 (file)
@@ -1 +1 @@
-801
+802
index 4ef4a1d..9921ab5 100644 (file)
@@ -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 <dirent.h>],[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 (file)
--- 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);