Re: datetime.h defines like PM conflict with external libraries

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: datetime.h defines like PM conflict with external libraries
Date: 2017-10-03 22:24:38
Message-ID: bd90cfc0-3b19-64bc-1504-d309f8311a34@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/03/2017 04:43 PM, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> On 2017-10-03 16:34:38 -0400, Andrew Dunstan wrote:
>>> AFAICT at a quick glance these are only used in a couple of files. Maybe
>>> the defs need to be floated off to a different header with more limited
>>> inclusion?
>> Why not just rename them to PG_PM etc? If we force potential external
>> users to do some changes, we can use more unique names just as well -
>> the effort to adapt won't be meaningfully higher... IMNSHO there's not
>> much excuse for defining macros like PM globally.
> I like the new-header-file idea because it will result in minimal code
> churn and thus minimal back-patching hazards.
>
> I do *not* like "PG_PM". For our own purposes that adds no uniqueness
> at all. If we're to touch these symbols then I'd go for names like
> "DATETIME_PM". Or maybe "DT_PM" ... there's a little bit of precedent
> for the DT_ prefix already.
>
>

Yeah. If we use a prefix +1 for DT_. If we do that then I think they
should *all* be prefixed, not just the ones we know of conflicts for.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-10-03 22:53:53 pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c
Previous Message Vik Fearing 2017-10-03 22:24:19 Re: [PATCH] WIP Add ALWAYS DEFERRED option for constraints