MinGW: Fix stat definitions to work with MinGW runtime version 4.0

For an overview of changes in mingwrt-4.0 see: http://sourceforge.net/p/mingw/mingw-org-wsl/ci/4.0.0/tree/NEWS Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sebastian Schuberth committed Sep 11, 2013 at 18:02 UTC fa93bb20d72edf9f7635c63d46101edb206d3d6f
3 files changed +10 -2
compat/mingw.c
-1
@@ -491,7 +491,6 @@ int mingw_stat(const char *file_name, struct stat *buf)
491 return do_stat_internal(1, file_name, buf);
492 }
493
494 -#undef fstat
494 int mingw_fstat(int fd, struct stat *buf)
495 {
496 HANDLE fh = (HANDLE)_get_osfhandle(fd);
compat/mingw.h
+9
@@ -271,11 +271,20 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
271 #define lseek _lseeki64
272
273 /* use struct stat with 64 bit st_size */
274 +#ifdef stat
275 +#undef stat
276 +#endif
277 #define stat _stati64
278 int mingw_lstat(const char *file_name, struct stat *buf);
279 int mingw_stat(const char *file_name, struct stat *buf);
280 int mingw_fstat(int fd, struct stat *buf);
281 +#ifdef fstat
282 +#undef fstat
283 +#endif
284 #define fstat mingw_fstat
285 +#ifdef lstat
286 +#undef lstat
287 +#endif
288 #define lstat mingw_lstat
289
290 #ifndef _stati64
config.mak.uname
+1 -1
@@ -500,7 +500,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
500 NO_INET_NTOP = YesPlease
501 NO_POSIX_GOODIES = UnfortunatelyYes
502 DEFAULT_HELP_FORMAT = html
503 - COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
503 + COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -D_USE_32BIT_TIME_T -DNOGDI -Icompat -Icompat/win32
504 COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
505 COMPAT_OBJS += compat/mingw.o compat/winansi.o \
506 compat/win32/pthread.o compat/win32/syslog.o \