Re: fix windows contrib compile warnings for redefined

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix windows contrib compile warnings for redefined
Date: 2004-10-21 18:39:42
Message-ID: 4178026E.2020407@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-10-21 18:41:27 Re: fix windows contrib compile warnings for redefined macros
Previous Message Tom Lane 2004-10-21 18:04:42 Re: fix windows contrib compile warnings for redefined macros