Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a4AcY-0001LR-9h for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Dec 2015 16:51:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a4AcX-0001R0-SV for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Dec 2015 16:51:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4Abu-0000Iu-Lw for pgsql-bugs@postgresql.org; Wed, 02 Dec 2015 16:50:30 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1a4Abs-0005Fm-0H for pgsql-bugs@postgresql.org; Wed, 02 Dec 2015 16:50:29 +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 D39EE860001; Wed, 2 Dec 2015 17:50:26 +0100 (CET) Date: Wed, 2 Dec 2015 17:50:26 +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: <20151202165026.GK5136@alap3.anarazel.de> References: <20151201165457.2760.18019@wrigleys.postgresql.org> <5176.1449005701@sss.pgh.pa.us> 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 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