]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
same-inode.h: don't depend on _GL_WINDOWS_STAT_INODES
authorAlan Modra <amodra@gmail.com>
Wed, 25 Feb 2026 23:51:37 +0000 (10:21 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 26 Feb 2026 00:05:51 +0000 (10:35 +1030)
It looks like assuming _GL_WINDOWS_STAT_INODES is 1 is likely our best
option.  See gnulib/m4/windows-stat-inodes.m4.  Note that this doesn't
really make SAME_INODE usable on windows hosts as a number of the
likely filesystems (FAT, HPFS, or NTFS) don't support st_ino.

* same-inode.h (SAME_INODE <_WIN32>): Remove _GL_WINDOWS_STAT_INODES
test.  Assume it is true.

include/same-inode.h

index a1d94c4cbf5c1f7f075b8336a038b3c3c8da11f1..9d9049843d185149eef4416b6dd04ebb7014a601 100644 (file)
      && (a).st_dev == (b).st_dev)
 # elif defined _WIN32 && ! defined __CYGWIN__
    /* Native Windows.  */
-#  if _GL_WINDOWS_STAT_INODES
-    /* stat() and fstat() set st_dev and st_ino to 0 if information about
-       the inode is not available.  */
-#   define SAME_INODE(a, b) \
-     (!((a).st_ino == 0 && (a).st_dev == 0) \
-      && (a).st_ino == (b).st_ino && (a).st_dev == (b).st_dev)
-#  else
-    /* stat() and fstat() set st_ino to 0 always.  */
-#   define SAME_INODE(a, b) 0
-#  endif
+   /* stat() and fstat() set st_dev and st_ino to 0 if information about
+      the inode is not available.  */
+#  define SAME_INODE(a, b) \
+    (!((a).st_ino == 0 && (a).st_dev == 0) \
+     && (a).st_ino == (b).st_ino && (a).st_dev == (b).st_dev)
 # else
 #  define SAME_INODE(a, b)    \
     ((a).st_ino == (b).st_ino \