The attached patch fixes a compiler warning on MinGW64
../../../../../build/gcc/src/libgfortran/io/unix.c:51:0: warning: "lseek" redefined [enabled by default]
which is due to MinGW64 now supporting LFS. (Seemingly, using a similar define as libgfortran.) The following patch should fix the issue.
Thanks for Kai for suggestions and testing the patch on MinGW64. The goal is that it also works with older MinGW64 and with 32bit MinGW, but that has not been tested ...
OK for the trunk? Tobias
2011-03-25 Tobias Burnus <bur...@net-b.de> * unix.c: Adapt stat defines now that MinGW64 supports LFS. Index: libgfortran/io/unix.c =================================================================== --- libgfortran/io/unix.c (Revision 171454) +++ libgfortran/io/unix.c (Arbeitskopie) @@ -48,11 +48,17 @@ #define WIN32_LEAN_AND_MEAN #include <windows.h> +#if !defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64 +#undef lseek #define lseek _lseeki64 +#undef fstat #define fstat _fstati64 +#undef stat #define stat _stati64 -typedef struct _stati64 gfstat_t; +#endif +typedef struct stat gfstat_t; + #ifndef HAVE_WORKING_STAT static uint64_t id_from_handle (HANDLE hFile)