+2016-12-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ same-inode: port to MinGW
+ Here st_ino is always 0, so change the definition of SAME_INODE so
+ that 1 means the two files are the same, 0 with st_ino != 0 means
+ they differ, and 0 with st_ino == 0 means we don’t know. Problem
+ reported by Bruno Haible (Bug#25146).
+ * doc/posix-headers/sys_stat.texi (sys/stat.h): Update.
+ * lib/same-inode.h (SAME_INODE): Return 0 on MinGW.
+
2016-12-04 Bruno Haible <bruno@clisp.org>
javacomp: Support Java 7 and 8.
@item
To partially work around the previous two problems, you can test for
nonzero @code{st_ino} and use the Gnulib @code{same-inode} module to
-compare nonzero values. For example, @code{(a.st_ino && SAME_INODE
-(a, b))} is true if the @code{struct stat} values @code{a} and
+compare nonzero values. For example, @code{SAME_INODE (a, b)}
+is true if the @code{struct stat} values @code{a} and
@code{b} are known to represent the same file, @code{(a.st_ino &&
!SAME_INODE (a, b))} is true if they are known to represent different
files, and @code{!a.st_ino} is true if it is not known whether they
-/* Determine whether two stat buffers refer to the same file.
+/* Determine whether two stat buffers are known to refer to the same file.
Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
&& (a).st_ino[1] == (b).st_ino[1] \
&& (a).st_ino[2] == (b).st_ino[2] \
&& (a).st_dev == (b).st_dev)
+# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* On MinGW, struct stat lacks necessary info, so always return 0.
+ Callers can use !a.st_ino to deduce that the information is unknown. */
+# define SAME_INODE(a, b) 0
# else
# define SAME_INODE(a, b) \
((a).st_ino == (b).st_ino \