Replace pg_restrict by standard restrict
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 29 Oct 2025 06:36:46 +0000 (07:36 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 29 Oct 2025 06:52:58 +0000 (07:52 +0100)
commitf0f2c0c1aef95757c4e7f144d5577e2b0d814279
tree6ad22c3af3a815fc0683ae4dd6f1cd677d612787
parentc094be259b918fbcae5bed12d6c6b64bcb4c4846
Replace pg_restrict by standard restrict

MSVC in C11 mode supports the standard restrict qualifier, so we don't
need the workaround naming pg_restrict anymore.

Even though restrict is in C99 and should be supported by all
supported compilers, we keep the configure test and the hardcoded
redirection to __restrict, because that will also work in C++ in all
supported compilers.  (restrict is not part of the C++ standard.)

For backward compatibility for extensions, we keep a #define of
pg_restrict around, but our own code doesn't use it anymore.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/0e3d8644-c01d-4374-86ea-9f0a987981f0%40eisentraut.org
12 files changed:
configure
configure.ac
meson.build
src/bin/pg_verifybackup/pg_verifybackup.c
src/bin/pg_verifybackup/pg_verifybackup.h
src/common/logging.c
src/common/string.c
src/include/c.h
src/include/common/logging.h
src/include/common/string.h
src/include/libpq/pqformat.h
src/include/pg_config.h.in