postgresql/config
Peter Eisentraut 1887d822f1 Support using copyObject in standard C++
Calling copyObject in C++ without GNU extensions (e.g. when using
-std=c++11 instead of -std=gnu++11) fails with an error like this:

error: use of undeclared identifier 'typeof'; did you mean 'typeid'

This is due to the C compiler used to compile PostgreSQL supporting
typeof, but that function actually not being present in the C++
compiler.  This fixes that by explicitely checking for typeof support
in C++, and then either use that or define typeof ourselves as:

    std::remove_reference_t<decltype(x)>

According to the paper that led to adding typeof to the C standard,
that's the C++ equivalent of the C typeof:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2927.htm#existing-decltype

Author: Author: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://www.postgresql.org/message-id/flat/DGPW5WCFY7WY.1IHCDNIVVT300%2540jeltef.nl
2026-03-02 11:48:13 +01:00
..
ax_pthread.m4 Update config/ax_pthread.m4 to latest upstream version. 2018-11-19 15:05:33 -05:00
c-compiler.m4 Support using copyObject in standard C++ 2026-03-02 11:48:13 +01:00
c-library.m4 Simplify checking for xlocale.h 2024-10-01 07:23:45 -04:00
check_decls.m4 Fix configure's AC_CHECK_DECLS tests to work correctly with clang. 2018-11-19 12:01:47 -05:00
check_modules.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
config.guess Update config.guess and config.sub 2025-04-09 12:41:54 +02:00
config.sub Update config.guess and config.sub 2025-04-09 12:41:54 +02:00
general.m4 Rename configure.in to configure.ac 2020-07-24 10:42:08 +02:00
install-sh Fix install-strip on Mac OS X 2012-08-21 23:42:43 -04:00
llvm.m4 jit: Drop redundant LLVM configure probes. 2025-12-30 20:24:42 +13:00
Makefile Install our "missing" script where PGXS builds can find it. 2015-12-11 16:15:05 -05:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
missing Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
perl.m4 Remove MSVC scripts 2023-12-20 09:44:37 +09:00
pkg.m4 Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
prep_buildtree Improve prep_buildtree 2025-08-04 14:06:58 +02:00
programs.m4 Don't put library-supplied -L/-I switches before user-supplied ones. 2025-07-29 15:17:40 -04:00
python.m4 Restore AIX support. 2026-02-23 13:34:22 -05:00
tcl.m4 configure: More use of AC_ARG_VAR 2019-01-18 08:38:34 +01:00