From 3a447f5959ac94af56430a393643f3b98d7b67b4 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sat, 13 May 2017 02:36:19 +0200
Subject: [PATCH] stat, fstat: Complete removal of old native Windows code.

* lib/stat.c: Remove old macrology for WINDOWS_NATIVE.
* lib/fstat.c: Likewise.
* lib/stat-w32.c: Likewise.
---
 ChangeLog      |  7 +++++++
 lib/fstat.c    |  6 ------
 lib/stat-w32.c | 19 ++++++++-----------
 lib/stat.c     | 10 ----------
 4 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 17f835dd92..f6cee1dc26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-05-13  Bruno Haible  <bruno@clisp.org>
+
+	stat, fstat: Complete removal of old native Windows code.
+	* lib/stat.c: Remove old macrology for WINDOWS_NATIVE.
+	* lib/fstat.c: Likewise.
+	* lib/stat-w32.c: Likewise.
+
 2017-05-13  Bruno Haible  <bruno@clisp.org>
 
 	stat: Complete removal of REPLACE_FUNC_STAT_DIR code.
diff --git a/lib/fstat.c b/lib/fstat.c
index 605ac7d85e..d2e04688f2 100644
--- a/lib/fstat.c
+++ b/lib/fstat.c
@@ -27,12 +27,6 @@
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 # define WINDOWS_NATIVE
-# if _GL_WINDOWS_64_BIT_ST_SIZE
-#  undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
-#  define stat _stati64
-#  undef fstat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
-#  define fstat _fstati64
-# endif
 #endif
 
 #if !defined WINDOWS_NATIVE
diff --git a/lib/stat-w32.c b/lib/stat-w32.c
index 4f4a105812..4818a57a8c 100644
--- a/lib/stat-w32.c
+++ b/lib/stat-w32.c
@@ -18,22 +18,19 @@
 
 #include <config.h>
 
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
 #include <sys/types.h>
 #include <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
-# endif
-# include <errno.h>
-# include <limits.h>
-# include <unistd.h>
-# include <windows.h>
+#include <errno.h>
+#include <limits.h>
+#include <unistd.h>
+#include <windows.h>
 
 /* Specification.  */
-# include "stat-w32.h"
+#include "stat-w32.h"
 
-# include "pathmax.h"
+#include "pathmax.h"
 
 /* GetFinalPathNameByHandle was introduced only in Windows Vista.  */
 typedef DWORD (WINAPI * GetFinalPathNameByHandleFuncType) (HANDLE hFile,
diff --git a/lib/stat.c b/lib/stat.c
index 696f3d643a..6e4d788ab7 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -29,16 +29,6 @@
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 # define WINDOWS_NATIVE
-# if _GL_WINDOWS_64_BIT_ST_SIZE
-#  undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
-#  define stat _stati64
-#  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
-#  undef REPLACE_FUNC_STAT_FILE
-# endif
 #endif
 
 #if !defined WINDOWS_NATIVE
-- 
2.39.5