Re: pgsql: Add configure infrastructure to detect support for C99's restric

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add configure infrastructure to detect support for C99's restric
Date: 2017-10-12 22:35:11
Message-ID: 20171012223511.oymahnwm6fnh4kdz@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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

Attachment Content-Type Size
0001-Use-C99-restrict-via-pg_restrict-rather-than-restric.patch text/x-diff 10.1 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-10-12 23:08:44 Re: pgsql: Improve performance of SendRowDescriptionMessage.
Previous Message Peter Geoghegan 2017-10-12 22:28:14 Re: pgsql: Fix traversal of half-frozen update chains

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-10-12 22:46:16 Re: Continuous integration on Windows?
Previous Message Peter Geoghegan 2017-10-12 22:28:14 Re: pgsql: Fix traversal of half-frozen update chains