Re: pgsql: Add configure infrastructure to detect support for C99's restric
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@postgresql.org
Date: 2017-10-12T22:35:11Z
Lists: pgsql-hackers
Attachments
Hi, On 2017-10-12 11:03:34 -0700, Andres Freund wrote: > On 2017-10-12 13:55:07 -0400, Tom Lane wrote: > > Or, if you insist on having it, we're going to have to go the pg_restrict > > route. I don't see why that means duplicating any configure logic: on > > non-Windows we can use the autoconf probe and then write > > "#define pg_restrict restrict". > > Yea, that should work. I'll try to come up with a patch. We can't do so unconditionally in c.h or such, because that'd again cause conflicts with __declspec(restrict) on MSVC versions that don't support restrict, because it'd require restrict to be defined empty. But it's easy to do so in configure, and then have a separate definition in pg_config.h.win32. Done so in the attached commit. It's slightly ugly to have two definitions of restrict in pg_config.h.in, but whatever. Greetings, Andres Freund
Commits
-
Use C99 restrict via pg_restrict, rather than restrict directly.
- 91d5f1a4a3e8 11.0 landed
-
Work around overly strict restrict checks by MSVC.
- 060b069984a6 11.0 landed
-
Add configure infrastructure to detect support for C99's restrict.
- 0b974dba2d6b 11.0 cited