pgsql: Define unconstify() and unvolatize() for C++.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Define unconstify() and unvolatize() for C++.
Date: 2023-12-11 20:49:27
Message-ID: E1rCnDS-009jre-Rx@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Define unconstify() and unvolatize() for C++.

These two macros wouldn't work if used in an inline function definition
in a header seen by g++, because __builtin_types_compatible_p is only
available in C. Redirect to standard C++ const_cast (which also
adds/removes volatile despite its name).

Per cpluspluscheck failure in a development branch.

Suggested-by: Peter Eisentraut <peter(at)eisentraut(dot)org>
Discussion: https://postgr.es/m/CA%2BhUKGK3OXFjkOyZiw-DgL2bUqk9by1uGuCnViJX786W%2BfyDSw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/baf7c93ed583949d837bc13f24a15a0efbcb1ae7

Modified Files
--------------
src/include/c.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2023-12-11 22:08:40 pgsql: Provide helper for retrying partial vectored I/O.
Previous Message Daniel Gustafsson 2023-12-11 19:24:26 Re: pgsql: llvmjit: Use explicit LLVMContextRef for inlining