delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/09/26/09:17:02

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:cc
:subject:references:in-reply-to:content-type; q=dns; s=default; b=
lohkDFt/TzZuVTPgfRKcBzWA/depZtWnIqC6RoOzK2VNL5EdOaPuQ+33Yfqb/7Pi
WpNGGAmS1njn+N/lt4GWoSi4QEaGs8IWXhnkodvBRKB+m25v73qGUPx16s6WWNJP
3u4uFFoK1SOQoIXkDP7MIOzbWsRsc3n2ItI2ahis4/o=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:cc
:subject:references:in-reply-to:content-type; s=default; bh=BEaD
qyzGmEYAl1nDecFNlvlYCzw=; b=GvQdPr508f5S/DUd4hgy92CV+4aal6tDo3Jj
xx1IrfSEjouMHY26u6xvONhqRrgcx1Ov2s1aQezRcOdlz6zSY/RcPsRYGR1yi5J2
rXM3wUdwWLKKTsIFp7QAcUpO5DXxEd4a6LydhoaUY6CCl7Jmpb0/DxC9NjObqCGO
6m7bco8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50,FREEMAIL_FROM,SPAM_SUBJECT autolearn=no version=3.3.2
X-HELO: mail-pb0-f42.google.com
X-Received: by 10.68.224.38 with SMTP id qz6mr1085952pbc.156.1380201405763; Thu, 26 Sep 2013 06:16:45 -0700 (PDT)
Message-ID: <524433AD.5030403@users.sourceforge.net>
Date: Thu, 26 Sep 2013 21:16:29 +0800
From: JonY <jon_y AT users DOT sourceforge DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
CC: "mingw-w64-public AT lists DOT sourceforge DOT net" <mingw-w64-public AT lists DOT sourceforge DOT net>
Subject: Re: winbase.h issue
References: <524410D4 DOT 5020705 AT gmail DOT com> <5244317D DOT 8080205 AT gmail DOT com>
In-Reply-To: <5244317D.8080205@gmail.com>
X-IsSubscribed: yes

--KLN0eWLF4EdAuU3oeeRP49D7EFAixNVgX
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: quoted-printable

On 9/26/2013 21:07, JonY wrote:
> On 9/26/2013 18:47, Noboru Uchida wrote:
>> When I try the following:
>>
>> $ echo "#include <windows.h>" >foo.cc && c++ -c foo.cc
>>
>> I get tons of redefinition errors on Interlocked functions in winbase.h.
>>
>=20
> Looks like it happens only in C++ mode.
>=20

Adding mingw-w64 list.
Here are some of the errors:

> /usr/include/w32api/winbase.h: In function =1B$B!F=1B(Bunsigned int _Inte=
rlockedIncrement(volatile unsigned int*)=1B$B!G=1B(B:
> /usr/include/w32api/winbase.h:2925:33: error: redefinition of =1B$B!F=1B(=
Bunsigned int _InterlockedIncrement(volatile unsigned int*)=1B$B!G=1B(B
>    FORCEINLINE unsigned __LONG32 InterlockedIncrement (unsigned __LONG32 =
volatile *Addend) { return (unsigned __LONG32) InterlockedIncrement ((volat=
ile __LONG32 *) Addend); }
>                                  ^
> /usr/include/w32api/winbase.h:2924:24: error: =1B$B!F=1B(Bunsigned int _I=
nterlockedIncrement(volatile unsigned int*)=1B$B!G=1B(B previously defined =
here
>    FORCEINLINE unsigned InterlockedIncrement (unsigned volatile *Addend) =
{ return (unsigned) InterlockedIncrement ((volatile __LONG32 *) Addend); }
>                         ^
> /usr/include/w32api/winbase.h: In function =1B$B!F=1B(Bunsigned int _Inte=
rlockedDecrement(volatile unsigned int*)=1B$B!G=1B(B:
> /usr/include/w32api/winbase.h:2930:33: error: redefinition of =1B$B!F=1B(=
Bunsigned int _InterlockedDecrement(volatile unsigned int*)=1B$B!G=1B(B
>    FORCEINLINE unsigned __LONG32 InterlockedDecrement (unsigned __LONG32 =
volatile *Addend) { return (unsigned __LONG32) InterlockedDecrement ((volat=
ile __LONG32 *) Addend); }
>                                  ^
> /usr/include/w32api/winbase.h:2929:24: error: =1B$B!F=1B(Bunsigned int _I=
nterlockedDecrement(volatile unsigned int*)=1B$B!G=1B(B previously defined =
here
>    FORCEINLINE unsigned InterlockedDecrement (unsigned volatile *Addend) =
{ return (unsigned __LONG32) InterlockedDecrement ((volatile __LONG32 *) Ad=
dend); }
>                         ^


So the declaration was:
> extern "C++" {
>   FORCEINLINE unsigned InterlockedIncrement (unsigned volatile *Addend) {=
 return (unsigned) InterlockedIncrement ((volatile __LONG32 *) Addend); }
>   FORCEINLINE unsigned __LONG32 InterlockedIncrement (unsigned __LONG32 v=
olatile *Addend) { return (unsigned __LONG32) InterlockedIncrement ((volati=
le __LONG32 *) Addend); }

Cygwin64 g++ wasn't happy with that. Cygwin 32bit mode is fine though.



--KLN0eWLF4EdAuU3oeeRP49D7EFAixNVgX
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (MingW32)

iQGcBAEBAgAGBQJSRDOzAAoJEEOnnvXyZv6Q8iQMAIxPEUOpudh5B4DfbHsKr8It
sVN1lhSW8XRSC6lByF9zloKbqredsl0sqMLm3FgWPZlp/euko4WPfK9ZxmVvFvrO
9NlvoOmZTUb5rB2dsIcDmUMHwKD77o6vzMnmSBdIq/Wzw44MfIsBBAV4vujipA75
EVzuLIZ7d0NhdUm9S2G4+9nRvu3thKYN7RK6xNqzk6LJcpnyx94VKGaVhBCCyYZa
JH76R8JeXfRD3BojAp9qWOZFVNgM1lWS/mKzqqJLksf21+N1/J+N4LY61EKGeCtj
dzw2OeG5Sz0humKesdvTKEoF/1OzQpKY7M4a5N1ERDfZP/ZALdRi5k+XO4b7W62F
Whwzmu9Xcz/Ucirm1YS+h30/Tkr3i+oHzAVsVTNIUAbFrE5I9fnmmFvBuxC3cjTv
rMmnegb6ejO4r9mDPEfHOxBuALSgkHEzjMfoQXP09wlziHCjH9s322wLo33XtaHZ
fExLV2p4Wls4oqvcbYERDspjUuPtoAFu7s0spz3oOQ==
=SxKl
-----END PGP SIGNATURE-----

--KLN0eWLF4EdAuU3oeeRP49D7EFAixNVgX--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019