Skip to content

Commit c753478

Browse files
committed
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 #6625)
1 parent 14ddd22 commit c753478

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/macros.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,15 @@
166166
# ifndef MSWIN
167167
# define mch_access(n, p) access((n), (p))
168168
# endif
169-
# define mch_fstat(n, p) fstat((n), (p))
169+
170+
// Use 64-bit fstat function if available.
171+
// NOTE: This condition is the same as for the stat_T type.
172+
# if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
173+
# define mch_fstat(n, p) _fstat64((n), (p))
174+
# else
175+
# define mch_fstat(n, p) fstat((n), (p))
176+
# endif
177+
170178
# ifdef MSWIN // has its own mch_stat() function
171179
# define mch_stat(n, p) vim_stat((n), (p))
172180
# else

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1370,
757759
/**/
758760
1369,
759761
/**/

0 commit comments

Comments
 (0)