* m4/stat.m4 (gl_FUNC_STAT): Update comments.
* lib/stat.c (stat) [mingw64]: Define to _stat.
* doc/posix-functions/stat.texi: Mention mingw64 bug.
+2012-04-14 Bruno Haible <bruno@clisp.org>
+
+ stat: Bypass buggy override in mingw64.
+ * m4/stat.m4 (gl_FUNC_STAT): Update comments.
+ * lib/stat.c (stat) [mingw64]: Define to _stat.
+ * doc/posix-functions/stat.texi: Mention mingw64 bug.
+
2012-04-14 Bruno Haible <bruno@clisp.org>
pathmax: Fix compilation error on MSVC 9.
@item
On some platforms, @code{stat("link-to-file/",buf)} succeeds instead
of failing with @code{ENOTDIR}.
-FreeBSD 7.2, AIX 7.1, Solaris 9.
+FreeBSD 7.2, AIX 7.1, Solaris 9, mingw64.
@item
On some platforms, @code{stat(".",buf)} and @code{stat("./",buf)} give
different results:
#include <sys/stat.h>
#undef __need_system_sys_stat_h
+#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+ && REPLACE_FUNC_STAT_FILE
+/* mingw64 has a broken stat() function, based on _stat(), in libmingwex.a.
+ Bypass it. */
+# define stat _stat
+# define REPLACE_FUNC_STAT_DIR 1
+# undef REPLACE_FUNC_STAT_FILE
+#endif
+
static inline int
orig_stat (const char *filename, struct stat *buf)
{
-# serial 8
+# serial 9
# Copyright (C) 2009-2012 Free Software Foundation, Inc.
#
mingw*) gl_cv_func_stat_dir_slash="guessing no";;
*) gl_cv_func_stat_dir_slash="guessing yes";;
esac])])
- dnl AIX 7.1, Solaris 9 mistakenly succeed on stat("file/")
- dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/")
+ dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
+ dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
+ dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
AC_CACHE_CHECK([whether stat handles trailing slashes on files],
[gl_cv_func_stat_file_slash],
[touch conftest.tmp