Re: BUG #13788: compile error in generic_msvc.h

Поиск
Список
Период
Сортировка
Искать
От
Paul Moore
Тема
Re: BUG #13788: compile error in generic_msvc.h
Дата
Msg-id
BN4PR07MB21318CFBCCED692610885141F10D0@BN4PR07MB2131.namprd07.prod.outlook.com
Ответ на
Список
Дерево обсуждения
BUG #13788: compile error in generic_msvc.h paul.moore@centrify.com
Re: BUG #13788: compile error in generic_msvc.h Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #13788: compile error in generic_msvc.h Paul Moore <paul.moore@centrify.com>
Re: BUG #13788: compile error in generic_msvc.h Andres Freund <andres@anarazel.de>
Re: BUG #13788: compile error in generic_msvc.h Paul Moore <paul.moore@centrify.com>
Re: BUG #13788: compile error in generic_msvc.h Andres Freund <andres@anarazel.de>
Re: BUG #13788: compile error in generic_msvc.h Paul Moore <paul.moore@centrify.com>
Yes on extern "C". I have other stuff working

Really what I am trying to do is invoke c# code. I am going to need to call=
 SPI. I tried to find out if anybody else had done it and found nothing.

The c++ code is simply a thin shim from native c to c#

-----Original Message-----
From: Andres Freund [mailto:andres@anarazel.de]=20
Sent: Wednesday, December 2, 2015 8:50 AM
To: Paul Moore 
Cc: Tom Lane ; pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #13788: compile error in generic_msvc.h

On 2015-12-02 16:13:07 +0000, Paul Moore wrote:
> The 32 bit functions are defined on unsigned types
>=20
> From winbase.h
>=20
> FORCEINLINE
> unsigned
> InterlockedCompareExchange(
>     _Inout_ _Interlocked_operand_ unsigned volatile *Destination,
>     _In_ unsigned Exchange,
>     _In_ unsigned Comperand
>     )
> {
>     return (unsigned) _InterlockedCompareExchange((volatile long*)=20
> Destination, (long) Exchange, (long) Comperand); }
>=20
> The cast fixes the 64 bit case.
>=20
> Full disclosure, I am compiling as c++. I think that might be the=20
> cause. I tried in a c project and did not get the same error

Given that win64 buildfarm members have happily been compiling this code I =
suspect that's the cause. Are you including the headers with extern "C" or =
not?

You're using SPI directly from C++? You got to be *very* careful doing that=
 - postgres uses longjmp which isn't necessarily compatible with C++ (doesn=
't call destructors to be called and such).
В списке pgsql-bugs по дате отправления
От: ydolgikh@jerasoft.net
Дата:
От: pbelbin@gmail.com
Дата:
FAQ