Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a72v6-0001s3-1I for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Dec 2015 15:14:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a72v5-0006zK-5B for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Dec 2015 15:14:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a72v4-0006z6-Nt for pgsql-bugs@postgresql.org; Thu, 10 Dec 2015 15:14:10 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1a72v0-0002bS-Cb for pgsql-bugs@postgresql.org; Thu, 10 Dec 2015 15:14:10 +0000 Received: from intern.anarazel.de (ns1.anarazel.de [217.115.131.41]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 94556860002; Thu, 10 Dec 2015 16:14:05 +0100 (CET) Date: Thu, 10 Dec 2015 16:14:03 +0100 From: Andres Freund To: Paul Moore Cc: Tom Lane , "pgsql-bugs@postgresql.org" Subject: Re: BUG #13788: compile error in generic_msvc.h Message-ID: <20151210151403.GB2551@alap3.anarazel.de> References: <20151201165457.2760.18019@wrigleys.postgresql.org> <5176.1449005701@sss.pgh.pa.us> <20151202165026.GK5136@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 > 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 > > > > 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