On Fri, Jul 4, 2025 at 10:11 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Andres Freund <andres@anarazel.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