]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fixes for C++ typeof implementation
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 11 Mar 2026 10:54:10 +0000 (11:54 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 11 Mar 2026 10:54:10 +0000 (11:54 +0100)
commit9c05f152b5dd7aeaa6e64bd4ed2fc86bab437073
treee799170d9e5c06f8fc8198f8c66759b9a20fe9f2
parentd4a080b8a190c4ba434a390939c995a50da12cf6
Fixes for C++ typeof implementation

This fixes two bugs in commit 1887d822f14.

First, if we are using the fallback C++ implementation of typeof, then
we need to include the C++ header <type_traits> for
std::remove_reference_t.  This header is also likely to be used for
other C++ implementations of type tricks, so we'll put it into the
global includes.

Second, for the case that the C compiler supports typeof in a spelling
that is not "typeof" (for example, __typeof__), then we need to #undef
typeof in the C++ section to avoid warnings about duplicate macro
definitions.

Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://www.postgresql.org/message-id/flat/92f9750f-c7f6-42d8-9a4a-85a3cbe808f3%40eisentraut.org
src/include/c.h