Re: fix windows contrib compile warnings for redefined - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: fix windows contrib compile warnings for redefined
Date
Msg-id 4178026E.2020407@dunslane.net
Whole thread Raw
In response to Re: fix windows contrib compile warnings for redefined macros  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: fix windows contrib compile warnings for redefined macros  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: fix windows contrib compile warnings for redefined  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> writes:
>
>
>>This patch fixes contrib so that it compiles under windows without
>>warnings about redefines for min, max, V_UNKNOWN and IDIGNORE
>>
>>
>
>Surely this is wrong.  You might be able to assume that Windows'
>definitions for min/max are the same as what this code is expecting,
>
>

I checked and they are, fairly much character for character I think.

>but it's a lot bigger stretch to assume that for the other ones.
>
>

I didn't. In one case (IDIGNORE) I changed the name of the macro to
avoid the conflict, and in the other (V_UKNOWN) I removed the Windows
def which has no applicability in that context (the Windows version
comes from oleauto.h).  Both of these cases occur in .c files and have
no effects outside these files.

>(Does tsearch2 still *work* after you change it this way??)
>
>

I don't know, because (as you know) tsearch2 is currently busted at the
link stage on Windows, and I don't know how to fix it - I was hoping
someone would have jumped on that by now. But by analysis it should not
have changed the behaviour at all.

>The right thing for the min/max macros is to get rid of them anyway,
>and use the Min/Max macros from c.h.
>
>

That's a fair point. I'll look at that.

cheers

andrew


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: fix windows contrib compile warnings for redefined macros
Next
From: Tom Lane
Date:
Subject: Re: fix windows contrib compile warnings for redefined macros