postgresql/src
Peter Eisentraut 476b35d4e3 tests: Add a test C++ extension module
While we already test that our headers are valid C++ using
headerscheck, it turns out that the macros we define might still
expand to invalid C++ code.  This adds a minimal test extension that
is compiled using C++ to test that it's actually possible to build and
run extensions written in C++.  Future commits will improve C++
compatibility of some of our macros and add usage of them to this
extension make sure that they don't regress in the future.

The test module is for the moment disabled when using MSVC.  In
particular, the use of designated initializers in PG_MODULE_MAGIC
would require C++20, for which we are currently not set up.  (GCC and
Clang support it as extensions.)  It is planned to fix this.

Author: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://www.postgresql.org/message-id/flat/CAGECzQR21OnnKiZO_1rLWO0-16kg1JBxnVq-wymYW0-_1cUNtg@mail.gmail.com
2026-01-20 16:42:30 +01:00
..
backend Use integer backend type when exec'ing a postmaster child 2026-01-20 16:41:04 +01:00
bin Don't set the truncation block length greater than RELSEG_SIZE. 2026-01-19 12:09:32 -05:00
common Remove #include <math.h> where not needed 2026-01-15 19:09:47 +01:00
fe_utils Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
include Add routine to free MCVList 2026-01-20 13:13:47 +09:00
interfaces Fix misc typos, mostly in comments 2026-01-08 18:10:08 +02:00
makefiles tests: Add a test C++ extension module 2026-01-20 16:42:30 +01:00
pl plpython: Streamline initialization 2026-01-15 12:11:52 +01:00
port strnlen() is now required 2026-01-08 08:51:20 +01:00
template Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
test tests: Add a test C++ extension module 2026-01-20 16:42:30 +01:00
timezone Update time zone data files to tzdata release 2025c. 2026-01-18 14:54:33 -05:00
tools Optimize LISTEN/NOTIFY via shared channel map and direct advancement. 2026-01-15 14:12:15 -05:00
tutorial Update copyright for 2026 2026-01-01 13:24:10 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in tests: Add a test C++ extension module 2026-01-20 16:42:30 +01:00
Makefile.shlib Use exported symbols list on macOS for loadable modules as well 2025-06-10 07:04:43 +02:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00