develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [ID 20010731.105] MinGW can't compile win32.c on Windows 2000

Thread Previous | Thread Next
From:
John Kristian
Date:
August 3, 2001 00:56
Subject:
Re: [ID 20010731.105] MinGW can't compile win32.c on Windows 2000
Message ID:
03a101c11bf2$2c9b5ee0$0100a8c0@JOHNKRISTIAN
I suggest the enclosed fix, to win32/win32.c.
I can compile it with MinGW-1.0.1, and also with the
old version of MinGW described in Perl 5.6.1 README.win32, that is
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2/gcc-2.95.2-msvcrt.exe
followed by
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2/fixes/quote-fix-msvcrt.exe
followed by
change the typedef for fpos_t from "long" to "long long" in the file i386-mingw32msvc/include/stdio.h
This version of MinGW contains gcc version 2.95.2 19991024, says `gcc -v`.

Is there another version of MinGW that's worth supporting?
Where can I get a copy?

- John Kristian

P.S.  One can't describe a MinGW version simply by stating its gcc version.
gcc is one of several components of MinGW, each component has a separate
versioning system, and many combinations of versions are possible (although
some combinations don't work).

I suggest changing win32/win32.c as follows (from `diff -u`):
------------------------------------------
@@ -1627,7 +1627,8 @@
        char *arch;
        GetSystemInfo(&info);

-#if (defined(__BORLANDC__)&&(__BORLANDC__<=0x520)) || defined(__MINGW32__)
+#if (defined(__BORLANDC__)&&(__BORLANDC__<=0x520)) \
+ || (defined(__MINGW32__) && !defined(_ANONYMOUS_UNION))
        switch (info.u.s.wProcessorArchitecture) {
 #else
        switch (info.wProcessorArchitecture) {
@@ -2047,7 +2048,7 @@
 DllExport char *
 win32_strerror(int e)
 {
-#ifndef __BORLANDC__           /* Borland intolerance */
+#if !defined __BORLANDC__ && !defined __MINGW32__      /* compiler intolerance */
     extern int sys_nerr;
 #endif
     DWORD source = 0;
@@ -2501,7 +2502,8 @@
     StreamId.dwStreamId = BACKUP_LINK;
     StreamId.dwStreamAttributes = 0;
     StreamId.dwStreamNameSize = 0;
-#if defined(__BORLANDC__) || defined(__MINGW32__)
+#if defined(__BORLANDC__) \
+ ||(defined(__MINGW32__) && !defined(_ANONYMOUS_UNION))
     StreamId.Size.u.HighPart = 0;
     StreamId.Size.u.LowPart = dwLen;
 #else
------------------------------------------

----- Original Message -----
From: "Paul Johnson" <paul@pjcj.net>
To: "John Kristian" <jmk2001@engineer.com>
Cc: "Konovalov, Vadim Vladimirovich (Vadim)" <vkonovalov@lucent.com>; <perl5-porters@perl.org>
Sent: Thursday, August 02, 2001 6:03 AM
Subject: Re: [ID 20010731.105] MinGW can't compile win32.c on Windows 2000

> On Wed, Aug 01, 2001 at 08:03:09AM -0700, John Kristian wrote:
> > Yes, I imagine the Perl 5.6.1 code worked with an older version of
> > MinGW (although I haven't tried it).  On the other hand, I expect most
> > people will use the current version of MinGW.  So, future versions of
> > Perl should change to work with the current MinGW.  IMHO.
>
> And what is that?  http://www.mingw.org/ suggests that the latest
> snapshot contains gcc-2.95.3-20010608, an older development snapshot is
> gcc-2.95.2-1, and the only mention of a release is gcc-2.95.2.
>
> The current code works with gcc-2.95.2 and requires changes for
> gcc-2.95.2-1.  I don't know about the latest snapshot.
>
> What is needed is some patches based on the version of the compiler.
> I'm sure we would all be grateful if you were able to put that together.
>
> See also
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-03/msg00937.html
> and subsequent discussion.



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About