Replace pg_restrict by standard restrict

Peter Eisentraut <peter@eisentraut.org>

Commit: f0f2c0c1aef95757c4e7f144d5577e2b0d814279
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2025-10-29T06:52:58Z
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

Files

PathChange+/−
configure modified +4 −14
configure.ac modified +4 −12
meson.build modified +6 −7
src/bin/pg_verifybackup/pg_verifybackup.c modified +2 −2
src/bin/pg_verifybackup/pg_verifybackup.h modified +2 −2
src/common/logging.c modified +2 −2
src/common/string.c modified +1 −1
src/include/c.h modified +6 −0
src/include/common/logging.h modified +2 −2
src/include/common/string.h modified +1 −1
src/include/libpq/pqformat.h modified +6 −6
src/include/pg_config.h.in modified +0 −4

Discussion