summaryrefslogtreecommitdiff
path: root/lib/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stat.c')
-rw-r--r--lib/stat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/stat.c b/lib/stat.c
index a18d5773d..f46e31d9b 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -27,6 +27,21 @@
#include <sys/stat.h>
#undef __need_system_sys_stat_h
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if _GL_WINDOWS_64_BIT_ST_SIZE
+# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
+# define stat _stati64
+# define REPLACE_FUNC_STAT_DIR 1
+# undef REPLACE_FUNC_STAT_FILE
+# elif 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
+#endif
+
static inline int
orig_stat (const char *filename, struct stat *buf)
{