On 04/17/2014 11:09 AM, Nigel Horne wrote:
On 17/04/2014 12:01, Reini Urban wrote:
On 04/17/2014 10:22 AM, Nigel Horne wrote:
To date I have been able to build Perl on Cygwin with no problems but on
a new machine I have had problems. Any version that I try to build
gives error when trying to compile cygwin.c:
nostdio.h:25:14: error: two or more data types in declaration specifiers
#define FILE struct _FILE
Any ideas?
yes, see 6cc44f6270d743bed3e552da82c044f377e1c777
avoid a "FILE" name conflict with cygwin's wchar.h
The 1.7.28 release of cygwin (or possible a separate package released
around the same time) header wchar.h includes the following code:
typedef __FILE FILE;
With PERLIO_NOT_STDIO set to true, the default for core source files, we
#include nostdio.h which does:
struct _FILE;
#define FILE struct _FILE
which turns the above code into:
typedef __FILE struct _FILE;
which isn't C.
Disable this hack for cygwin.c
--- cygwin/cygwin.c
+++ cygwin/cygwin.c
@@ -2,6 +2,7 @@
* Cygwin extras
*/
+#define PERLIO_NOT_STDIO 0
#include "EXTERN.h"
#include "perl.h"
#undef USE_DYNAMIC_LOADING
Thanks. I think that answers my question, I'll give it a go later this
evening, though that won't help the scenario when doing 'perlbrew install'.
Is this a bug in Cygwin? It's bad that it breaks something as
fundamental as Perl.
I would rather call it a perl bug.
It should not #define FILE struct _FILE in the first hand.