Re: cpluspluscheck vs ICU again

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: cpluspluscheck vs ICU again
Date: 2025-07-07 05:52:58
Message-ID: CANWCAZavwgVepVY1vuNFyi=eSmNO-uR=Tffmw0_wJ7Xiz0k3+g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 4, 2025 at 10:11 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Andres Freund <andres(at)anarazel(dot)de> writes:

> >> +/* restore so that extensions can include the C++ APIs */
> >> +#undef U_SHOW_CPLUSPLUS_API
>
> > Does the #undef U_SHOW_CPLUSPLUS_API thing actually work, given that ucol.h
> > presumably won't be included again due to #ifdef protection?
>
> Good point. If a .cpp file wants access to the C++ APIs, it'd have
> to include <unicode/ucol.h> before not after including pg_locale.h.
> That should work AFAICS, but this #undef doesn't help.

I see that now. If extensions follow the practice of including system
headers before Postgres headers, it should be fine. I've attached v2
which removes the useless #undef and drafts an explanatory commit
message.

--
John Naylor
Amazon Web Services

Attachment Content-Type Size
v2-0001-Hide-ICU-C-APIs-from-pg_locale.h.patch text/x-patch 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-07-07 05:56:29 Re: Adding wait events statistics
Previous Message Dilip Kumar 2025-07-07 05:40:39 Re: A recent message added to pg_upgade