This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Silence compiler warnings with gcc 4.7.2 and 4.8.1 from www.mingw.org
authorSteve Hay <steve.m.hay@googlemail.com>
Tue, 10 Feb 2015 08:23:22 +0000 (08:23 +0000)
committerSteve Hay <steve.m.hay@googlemail.com>
Wed, 11 Feb 2015 08:10:19 +0000 (08:10 +0000)
These compilers (with other contemporaneous packages, I forget exactly
which versions of everything I have installed) contain

#define fstat _fstat

in include/sys/stat.h, which clashes with win32/win32iop.h's #define and
causes "warning: "fstat" redefined [enabled by default]" for just about
every .c file compiled. Likewise for stat.

win32/win32iop.h

index 246375f..9b1b4e2 100644 (file)
@@ -289,11 +289,11 @@ END_EXTERN_C
 #  undef abort
 #endif
 #define abort()                        win32_abort()
-#ifdef UNDER_CE
+#if defined(UNDER_CE) || defined(__MINGW32__)
 #  undef fstat
 #endif
 #define fstat(fd,bufptr)       win32_fstat(fd,bufptr)
-#ifdef UNDER_CE
+#if defined(UNDER_CE) || defined(__MINGW32__)
 #  undef stat
 #endif
 #define stat(pth,bufptr)       win32_stat(pth,bufptr)