changeset 21640:e7801d132dcb v8.2.1370

patch 8.2.1370: MS-Windows: warning for using fstat() with stat_T Commit: https://github.com/vim/vim/commit/c753478b82613df37b145764e27f5514542edb97 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 5 12:10:50 2020 +0200 patch 8.2.1370: MS-Windows: warning for using fstat() with stat_T Problem: MS-Windows: warning for using fstat() with stat_T. Solution: use _fstat64() if available. (Naruhiko Nishino, closes https://github.com/vim/vim/issues/6625)
author Bram Moolenaar <Bram@vim.org>
date Wed, 05 Aug 2020 12:15:04 +0200
parents 651e12be4670
children 20b0520f1174
files src/macros.h src/version.c
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/macros.h
+++ b/src/macros.h
@@ -166,7 +166,15 @@
 # ifndef MSWIN
 #   define mch_access(n, p)	access((n), (p))
 # endif
-# define mch_fstat(n, p)	fstat((n), (p))
+
+// Use 64-bit fstat function if available.
+// NOTE: This condition is the same as for the stat_T type.
+# if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
+#  define mch_fstat(n, p)	_fstat64((n), (p))
+# else
+#  define mch_fstat(n, p)	fstat((n), (p))
+# endif
+
 # ifdef MSWIN	// has its own mch_stat() function
 #  define mch_stat(n, p)	vim_stat((n), (p))
 # else
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1370,
+/**/
     1369,
 /**/
     1368,