bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building Diffutils with MinGW


From: Jim Meyering
Subject: Re: Building Diffutils with MinGW
Date: Sat, 05 May 2012 15:59:58 +0200

Eli Zaretskii wrote:
> Yet another issue is with this part of src/system.h:
>
>   #ifndef same_special_file
>   # if HAVE_ST_RDEV && defined S_ISBLK && defined S_ISCHR
>   #  define same_special_file(s, t) \
>        (((S_ISBLK ((s)->st_mode) && S_ISBLK ((t)->st_mode)) \
>        || (S_ISCHR ((s)->st_mode) && S_ISCHR ((t)->st_mode))) \
>       && (s)->st_rdev == (t)->st_rdev)
>   # else
>   #  define same_special_file(s, t) 0
>   # endif
>   #endif
>
> Since the configure script doesn't test for HAVE_ST_RDEV, the upshot
> of this seems to be that same_special_file will always yield zero on
> all platforms, which doesn't seem to be the intent.  Apologies if I
> missed something important.

Thanks for the report.  configure.ac does test for the stat.st_rdev member.

    AC_CHECK_MEMBERS([struct stat.st_rdev])

The cpp expression should test HAVE_STRUCT_STAT_ST_RDEV, not HAVE_ST_RDEV.
That was due to an 11-year-old typo.
I've fixed it with this:

>From 3c19ca08b1cf7aaaae72393073affaa082928ae4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 5 May 2012 15:51:25 +0200
Subject: [PATCH] diff: fix a typo that was always disabling the
 same_special_file macro

* src/system.h (same_special_file): Correct cpp guard expression:
s/HAVE_ST_RDEV/HAVE_STRUCT_STAT_ST_RDEV/.  Reported by Eli Zaretskii.
---
 src/system.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/system.h b/src/system.h
index 2767b57..eb9ed53 100644
--- a/src/system.h
+++ b/src/system.h
@@ -151,7 +151,7 @@ verify (sizeof (lin) <= sizeof (long int));

 /* Do struct stat *S, *T describe the same special file?  */
 #ifndef same_special_file
-# if HAVE_ST_RDEV && defined S_ISBLK && defined S_ISCHR
+# if HAVE_STRUCT_STAT_ST_RDEV && defined S_ISBLK && defined S_ISCHR
 #  define same_special_file(s, t) \
      (((S_ISBLK ((s)->st_mode) && S_ISBLK ((t)->st_mode)) \
        || (S_ISCHR ((s)->st_mode) && S_ISCHR ((t)->st_mode))) \
--
1.7.10.1.457.g8275905



reply via email to

[Prev in Thread] Current Thread [Next in Thread]