]> granicus.if.org Git - vim/commitdiff
patch 8.2.1370: MS-Windows: warning for using fstat() with stat_T v8.2.1370
authorBram Moolenaar <Bram@vim.org>
Wed, 5 Aug 2020 10:10:50 +0000 (12:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 5 Aug 2020 10:10:50 +0000 (12:10 +0200)
Problem:    MS-Windows: warning for using fstat() with stat_T.
Solution:   use _fstat64() if available. (Naruhiko Nishino, closes #6625)

src/macros.h
src/version.c

index 7604910a6d6e5a7adf5915f5a56638f1795ebc57..7557b2691769d62e9e31c8f83e1758017af38ea2 100644 (file)
 # 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
index a0f4593b2d7d598df294f8069415f573f281c92c..5246d84c2e711c430dce2ab53983ae2bb9c63f2e 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1370,
 /**/
     1369,
 /**/