pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Paul Moore <paul.moore@centrify.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13788: compile error in generic_msvc.h
Date: Thu, 10 Dec 2015 16:14:03 +0100
Message-ID: <20151210151403.GB2551@alap3.anarazel.de> (raw)
In-Reply-To: <BN4PR07MB21318CFBCCED692610885141F10D0@BN4PR07MB2131.namprd07.prod.outlook.com>
References: <20151201165457.2760.18019@wrigleys.postgresql.org>
	<5176.1449005701@sss.pgh.pa.us>
	<BN4PR07MB2131DF8027DFBFD628475070F10E0@BN4PR07MB2131.namprd07.prod.outlook.com>
	<20151202165026.GK5136@alap3.anarazel.de>
	<BN4PR07MB21318CFBCCED692610885141F10D0@BN4PR07MB2131.namprd07.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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@anarazel.de] 
> Sent: Wednesday, December 2, 2015 8:50 AM
> To: Paul Moore <paul.moore@centrify.com>
> Cc: Tom Lane <tgl@sss.pgh.pa.us>; 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
> > 
> > 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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
Greetings,

Andres Freund


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)  latest in thread

Message-ID: <20151210151403.GB2551@alap3.anarazel.de>
Permalink:  ../20151210151403.GB2551@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20151210151403.GB2551@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@anarazel.de, paul.moore@centrify.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #13788: compile error in generic_msvc.h
  In-Reply-To: <20151210151403.GB2551@alap3.anarazel.de>
  References: <20151201165457.2760.18019@wrigleys.postgresql.org> <5176.1449005701@sss.pgh.pa.us> <BN4PR07MB2131DF8027DFBFD628475070F10E0@BN4PR07MB2131.namprd07.prod.outlook.com> <20151202165026.GK5136@alap3.anarazel.de> <BN4PR07MB21318CFBCCED692610885141F10D0@BN4PR07MB2131.namprd07.prod.outlook.com> <20151210151403.GB2551@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox