1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-16 15:02:33 +03:00

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
This commit is contained in:
Peter Eisentraut
2025-10-29 07:36:46 +01:00
parent c094be259b
commit f0f2c0c1ae
12 changed files with 36 additions and 53 deletions

View File

@@ -206,7 +206,7 @@ pg_logging_set_locus_callback(void (*cb) (const char **filename, uint64 *lineno)
void
pg_log_generic(enum pg_log_level level, enum pg_log_part part,
const char *pg_restrict fmt,...)
const char *restrict fmt,...)
{
va_list ap;
@@ -217,7 +217,7 @@ pg_log_generic(enum pg_log_level level, enum pg_log_part part,
void
pg_log_generic_v(enum pg_log_level level, enum pg_log_part part,
const char *pg_restrict fmt, va_list ap)
const char *restrict fmt, va_list ap)
{
int save_errno = errno;
const char *filename = NULL;