Re: Fix compilation using mingw.org's MinGW

Eli Zaretskii
2019-04-30T17:40:35Z

> Cc: lrn1986@gmail.com, gdb-patches@sourceware.org
> From: Pedro Alves <palves@redhat.com>
> Date: Tue, 30 Apr 2019 18:26:19 +0100
>
> On 4/30/19 6:17 PM, Eli Zaretskii wrote:
> >> Cc: gdb-patches@sourceware.org
> >> From: Pedro Alves <palves@redhat.com>
> >> Date: Tue, 30 Apr 2019 18:03:57 +0100
> >>
> >> The issue is where is that default set?
> >
> > On some internal header file (it differs between various flavors of
> > MinGW).
>
> Right, which is what I said.

Yes.

> > But no matter where it is set, it must be defined after _any_
> > standard header is included, so in practice I think it's defined at
> > the place where the patch tests for it.
>
> I think you mean "before".

No, I meant "after". The default value is set once you included at
least on standard header. Hence you can at that place test for
whether it is defined and what is its default value. Overriding that
default is generally important only before including w32api headers,
such as windows.h.

> But I did not say that this was the wrong
> place (since I was the one that suggested the place). Only that
> pedantically the new code could/should be tweaked like this:
>
> - #ifdef __MINGW32__
> + #if defined (__MINGW32__) || defined (__CYGWIN__)

If you want me to add __CYGWIN__, I'm okay with that.

> > In any case, the only platform which really needs this is mingw.org's
> > MinGW, where I actually tested this assumption. The other two,
> > MinGW64 and Cygwin, don't support older platforms (they actually don't
> > support XP anymore, only Vista and onward), so their default values
> > are higher than 0x0501 anyway.
> >
>
> Right, like I said.

Sure, we agree. I didn't mean to contradict what you were saying, I
wanted to back that up.