From: | Paul Moore <paul(dot)moore(at)centrify(dot)com> |
---|---|
To: | Andres Freund <andres(at)anarazel(dot)de> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: BUG #13788: compile error in generic_msvc.h |
Date: | 2015-12-10 17:27:08 |
Message-ID: | BN4PR07MB2131E7BF8BC8E8A443A5A0D3F1E90@BN4PR07MB2131.namprd07.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
I put the cast in and it compiles with no complaint
-----Original Message-----
From: Andres Freund [mailto:andres(at)anarazel(dot)de]
Sent: Thursday, December 10, 2015 7:14 AM
To: Paul Moore <paul(dot)moore(at)centrify(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>; pgsql-bugs(at)postgresql(dot)org
Subject: Re: [BUGS] BUG #13788: compile error in generic_msvc.h
Hi Paul,
As I don't have access to msvc: Could you try what Tom suggested in http://archives.postgresql.org/message-id/5176.1449005701%40sss.pgh.pa.us ?
Regards,
Andres
On 2015-12-03 17:02:31 +0000, Paul Moore wrote:
> 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(at)anarazel(dot)de]
> Sent: Wednesday, December 2, 2015 8:50 AM
> To: Paul Moore <paul(dot)moore(at)centrify(dot)com>
> Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>; pgsql-bugs(at)postgresql(dot)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
> >
> > From winbase.h
> >
> > FORCEINLINE
> > unsigned
> > InterlockedCompareExchange(
> > _Inout_ _Interlocked_operand_ unsigned volatile *Destination,
> > _In_ unsigned Exchange,
> > _In_ unsigned Comperand
> > )
> > {
> > return (unsigned) _InterlockedCompareExchange((volatile long*)
> > Destination, (long) Exchange, (long) Comperand); }
> >
> > The cast fixes the 64 bit case.
> >
> > Full disclosure, I am compiling as c++. I think that might be the
> > 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).
>
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org) To make
> changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
Greetings,
Andres Freund
From | Date | Subject | |
---|---|---|---|
Next Message | darin | 2015-12-10 19:52:22 | BUG #13812: 'now' acting differently than now() in function |
Previous Message | Andres Freund | 2015-12-10 15:51:36 | Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement. |