[Mingw-users] Problems with compiling Windows system calls with MinGW gcc 6.3.0

Back to archive index

Keith Marshall keith****@users*****
Fri Jun 29 23:58:09 JST 2018


On 28/06/18 20:39, Earnie wrote:
>> The mapping was already defined, to GetFileAttributesExA, because
>> he did not define UNICODE/_UNICODE in time ... that *must* come
>> *before*
>> 
>>    #include <_mingw.h>
> 
> The better fix would be to remove this include altogether as it is
> included by every include file anyway.

Ordinarily, I would agree with you.  However, in this case we must
recognize that David's test case is a cut down variant of an existing
GCC internal header, which is specific to mingw32 host builds of GCC
itself, and:

  1) That GCC header already had "#include <_mingw.h>" in place, albeit
     improperly, because it preceded its feature test prerequisites.

  2) While correcting the order, I found it necessary (but I no longer
     recall why) to add _BEGIN_C_DECLS/_END_C_DECLS wrapper code, and
     those require <_mingw.h>, so I left it in the *correct* place.

Okay, looking at it again, I see that I could have delayed the placement
of _BEGIN_C_DECLS, (or I could have written out its infinitely uglier
conditional expansion), until after a subsequent "#include <windows.h>",
which would have implicitly included <_mingw.h> anyway.  But all of that
is secondary to, and a distraction from the real issue here: the
original mingw32.h improperly included <_mingw.h> before specifying
prerequisite feature tests; it is irrelevant whether that inclusion was
explicit, (as it was), or implicit, (as it just as easily could have
been).  Much more critical, to the issue, was the ordering of includes
within adaint.c, and its associated rtinit.c, (in both of which the
feature tests should ideally have been specified in the first place);
they had *other* headers included *before* mingw32.h, (to which the
feature test specifications have been delegated); any one of those
headers could have caused a premature implicit inclusion of <_mingw.h>.

I certainly don't intend embarking on a rebuild of gcc-6.3.0-mingw32
just for the sake of a nicety of implicit vs. explicit inclusion of
<_mingw.h> in a patch file, especially since such a change would make
not a blind bit of difference to the build anyway.

-- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
Url : https://lists.osdn.me/mailman/archives/mingw-users/attachments/20180629/5e8a9ef5/attachment.pgp 



More information about the MinGW-Users mailing list
Back to archive index