From 47071f8b14a0a0fdd9d79bef11535190cd089685 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 26 Feb 2026 10:21:37 +1030 Subject: [PATCH] same-inode.h: don't depend on _GL_WINDOWS_STAT_INODES 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 | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/include/same-inode.h b/include/same-inode.h index a1d94c4cbf5..9d9049843d1 100644 --- a/include/same-inode.h +++ b/include/same-inode.h @@ -28,16 +28,11 @@ && (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 \