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

From Peter Eisentraut
Subject Re: Make copyObject work in C++
Date
Msg-id df1834bc-f640-4d26-be81-a84f6da33c46@eisentraut.org
Whole thread Raw
In response to Re: Make copyObject work in C++  ("Jelte Fennema-Nio" <postgres@jeltef.nl>)
Responses Re: Make copyObject work in C++
List pgsql-hackers
On 25.01.26 18:52, Jelte Fennema-Nio wrote:
> On Sun Jan 25, 2026 at 5:50 PM CET, Andres Freund wrote:
>> I'm pretty sceptical this is the right direction. 
> 
> The only other option I can think of is not supporting C++ extension on
> MSVC unless they are compiled with C++20 (or later). I don't
> particularly care about Windows C++ extensions myself, so I personally
> would be fine with that choice. It seems a bit harsh, though.

Maybe it would be enough to only support PG_MODULE_MAGIC (without 
arguments) in C++ for now.

That would still require removing the named initializers inside 
PG_MODULE_MAGIC_DATA(), but that's only an internal change, and it would 
not affect C-language users of PG_MODULE_MAGIC_EXT, and we wouldn't lock 
ourselves into a particular style in C++.

Then, maybe in a couple of years, when C++20 is more widely available, 
we could enable PG_MODULE_MAGIC_EXT for C++, or design an alternative 
construct for C++.




pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Safer hash table initialization macro
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: Make copyObject work in C++