Re: remove pg_restrict workaround

Jelte Fennema-Nio <postgres@jeltef.nl>

From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-01-02T23:23:37Z
Lists: pgsql-hackers
On Wed, 29 Oct 2025 at 08:04, Peter Eisentraut <peter@eisentraut.org> wrote:
> Committed with a backward compatibility define.

I'm working on adding a C++ extension module to my copyObject
patchset[1]. But turns out that this change has completely broken
compiling C++ extensions on MSVC. This is happening due to
__declspec(restrict) being replaced by __declspec(__restrict), which
the original comments also mentioned as the reason for having our own
flavor. This replacement then makes the core of a corecrt_malloc.h
MSVC header invalid[2].

So I think we should revert this patch.

[1]: https://www.postgresql.org/message-id/flat/CAGECzQR21OnnKiZO_1rLWO0-16kg1JBxnVq-wymYW0-_1cUNtg@mail.gmail.com
[2]: https://cirrus-ci.com/task/5516067944005632?logs=build#L2031-L2044



Commits

  1. Revert "Replace pg_restrict by standard restrict"

  2. Replace pg_restrict by standard restrict

  3. Remove meaninglist restrict qualifiers