generic-msvc.h(91): error C2664

From: Vicky Vergara <vicky_vergara(at)hotmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: generic-msvc.h(91): error C2664
Date: 2017-11-22 03:01:47
Message-ID: BY1PR11MB0423B08FD4F125827412A32C8A200@BY1PR11MB0423.namprd11.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello all

I am trying to compile pgRouting on appveyor CI when compiling with pg >= 9.5

I am getting the following error:

C:\Program Files\PostgreSQL\9.5\include\server\port/atomics/generic-msvc.h(91): error C2664: '__int64 _InterlockedCompareExchange64(volatile __int64 *,__int64,__int64)' : cannot convert argument 1 from 'volatile uint64 *' to 'volatile __int64 *' [C:\build\pgrouting\build\pg95\x64\src\tsp\tsp.vcxproj]

This error happens when C++ code that needs palloc is being compiled.

There is no problem when compiling C code.

On the documentation of the _InterlockedExchangeAdd64 [1] there is no uint64 * type

This code [2] use [3] where uint64 is used

Maybe I am doing something wrong including some postgres files on these [4] & [5].

A sample compilation with this error is in [6] and there is no problem at all with pg 9.4 [7]

Any feedback would be greatly appreciated

Vicky

[1] https://docs.microsoft.com/en-us/cpp/intrinsics/interlockedexchangeadd-intrinsic-functions

[2] https://github.com/postgres/postgres/blob/REL9_5_STABLE/src/include/port/atomics/generic-msvc.h#L101

[3] https://github.com/postgres/postgres/blob/REL9_5_STABLE/src/include/port/atomics/generic-msvc.h#L43

[4] https://github.com/cvvergara/pgrouting/blob/appveyor-pg95/include/cpp_common/pgr_alloc.hpp

[5] https://github.com/cvvergara/pgrouting/blob/appveyor-pg95/include/c_common/postgres_connection.h

[6] https://ci.appveyor.com/project/cvvergara/pgrouting/build/2.6.1936#L415

[7] https://ci.appveyor.com/project/cvvergara/pgrouting/build/2.6.1934
<https://github.com/postgres/postgres/blob/master/src/include/port/atomics/generic-msvc.h#L41>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-11-22 03:57:34 Re: Failed to delete old ReorderBuffer spilled files
Previous Message Craig Ringer 2017-11-22 02:55:38 Re: Logical Replication and triggers