Re: Make copyObject work in C++ - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: Make copyObject work in C++
Date
Msg-id DESOMJEHA095.2MY9A7RE7AVT1@jeltef.nl
Whole thread Raw
In response to Re: Make copyObject work in C++  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun Dec 7, 2025 at 8:45 PM CET, Tom Lane wrote:
> #ifdef __cplusplus
> #undef typeof
> #define typeof decltype
> #define HAVE_TYPEOF 1
> #endif

Went with defining pg_exprtype (pg_typeof already exists). Undefining
typeof seemed a bit heavy-handed. Especially since I think it would be
nice to backport this so C++ extensions can use copyObject directly.

> BTW, grepping finds a number of random references to __typeof__ and
> __typeof, which probably ought to be updated to be just typeof.

Added a follow on patch that starts using pg_exrtype in all those
places.

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Make copyObject work in C++
Next
From: Bilal Yavuz
Date:
Subject: Re: meson and check-tests