public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, libgFortran] Fix MinGW64 compile warning
@ 2011-03-25 17:14 Tobias Burnus
  2011-03-26  9:27 ` Janne Blomqvist
  0 siblings, 1 reply; 4+ messages in thread
From: Tobias Burnus @ 2011-03-25 17:14 UTC (permalink / raw)
  To: gcc patches, gfortran

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

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

[-- Attachment #2: win-lfs.diff --]
[-- Type: text/x-patch, Size: 690 bytes --]

2011-03-25  Tobias Burnus  <burnus@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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-03 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25 17:14 [Patch, libgFortran] Fix MinGW64 compile warning Tobias Burnus
2011-03-26  9:27 ` Janne Blomqvist
2011-04-03 15:11   ` Tobias Burnus
2011-04-03 15:26     ` Janne Blomqvist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).