Re: pgsql: Move strtoint() to common

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Move strtoint() to common
Date: 2018-03-15 00:28:51
Message-ID: 20180315002851.GC617@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Wed, Mar 14, 2018 at 11:23:35AM -0400, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> > I think the problem is rather that we somehow need to tell it to link
> > src/common/string.c into pgtypeslib.
>
> Yeah, that's what I supposed.
>
> Looking at pgtypeslib, there's already infrastructure for collecting
> stuff from src/port/, and I see you added some for src/common/ in
> its Makefile, but evidently not in the MSVC scripts. It looks like
> the way the MSVC build works now is dependent on @pgportfiles.
>
> You could invent parallel infrastructure for src/common/, but I wonder
> whether the path of least resistance might not be to put strtoint()
> into src/port/ instead.

This line from the buildfarm failures is indicating that the handling of
restrict is incorrect:
src/common/string.c(50): error C2146: syntax error : missing ')' before
identifier 'str'
[C:\buildfarm\buildenv\HEAD\pgsql.build\libpgtypes.vcxproj]

So I concur with David that we ought to do something for that. One way
to do things simply is to remove the restrict keyword as suggested
upthread. Another one, which David has not considered, is that there is
a pg_restrict macro defined in pg_config.h. So you could just use that.

Attached is a patch which fixes the compilation failure on Windows for
me. That should put the buildfarm back to green.
--
Michael

Attachment Content-Type Size
fix-msvc-compile.patch text/x-diff 943 bytes

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-15 00:34:51 pgsql: logical replication: fix OID type mapping mechanism
Previous Message Andrew Dunstan 2018-03-14 23:45:46 Re: pgsql: Remove pg_class.relhaspkey