New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build failure on Win32 with gcc 4.7.2/4.8.1 from www.mingw.org #14494
Comments
From @steve-m-hayIn commit 0bcc29e I've just silenced some compiler warnings from In a normal C build with the default configuration, doio.c now has ..\doio.c: In function 'S_openn_cleanup': In a C++ mode build that becomes an error: ..\doio.c: In function 'bool S_openn_cleanup(GV*, IO*, PerlIOl**, The problem is that the #undef/#define of stat (the stat() function!) doio.c includes perl.h, which includes the config.h (line 28), then #define Stat_t struct stat These compilers' sys/stat.h give us: #ifndef _STAT_DEFINED #else /* !_USE_32BIT_TIME_T */ #endif /* _USE_32BIT_TIME_T */ #endif /* _STAT_DEFINED */ #if !defined(_NO_OLDNAMES) && !defined(__STRICT_ANSI__) None of _STAT_DEFINED, USE_32BIT_TIME_T, _NO_OLDNAMES or DllExport int win32_fstat(int fd, struct _stat64i32 *sbufptr); but the same file also then does this: #if defined(UNDER_CE) || defined(__MINGW32__) and that last #undef/#define of stat messes with sys/stat.h's #define Therefore, when we reach the #include of intrpvar.h nearing the end of struct stat PL_statbuf; rather than the intended struct _stat64i32 PL_statbuf which then causes the compiler warning/error shown earlier about a I'm not sure how best to fix this. I'm wondering if _USE_32BIT_TIME_T should actually be defined, as it I've also experimented with defining _NO_OLDNAMES and/or The only workaround that I have at the moment is the slightly gross Inline Patchdiff --git a/win32/win32iop.h b/win32/win32iop.h
index 842bc07..0cf9b59 100644
--- a/win32/win32iop.h
+++ b/win32/win32iop.h
@@ -296,6 +296,10 @@ END_EXTERN_C
# undef stat
#endif
#define stat(pth,bufptr) win32_stat(pth,bufptr)
+#ifdef __MINGW32__
+#undef _STAT_H_
+#include <sys/stat.h>
+#endif
#define longpath(pth) win32_longpath(pth)
#define ansipath(pth) win32_ansipath(pth)
#ifdef UNDER_CE |
From @bulk88On Wed Feb 11 00:58:44 2015, shay wrote:
I dont have time to respond ATM, but I think https://rt-archive.perl.org/perl5/Ticket/Display.html?id=121448 is slightly related. -- |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#123794 (status was 'open')
Searchable as RT123794$
The text was updated successfully, but these errors were encountered: