delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/08/03/09:46:18

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:date:from:to:cc:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=fFmOKnQBCUtJX3WP7zmTzgmPeOnotDB5j/SwliwdHcxXznYk5asy/
vsEtVkCPn781Vci/TDhuZ27TAUsbgvsuFm9EDYHcMqAKAFY9tqTZ4JmrLgVS3PX6
zdbaeWU7CENhyUYT8VGkHQ2mgaWPgurKWzKETVosUZ7MKnoV40w6S8=
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:date:from:to:cc:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=wT0Sq6rcxiLyMrngmJwRGT00dDg=; b=ydKaLB6rpfBkVE2cyUmMaH5qK7iM
emMfHwjaIM1A0tg6pUQPFLBAoPCv1t1uYblSuQVIuTKuitkyHg8D8ogs01mEQBHX
ZhPJhSFkKatB17mc7zTnKdLDAVZRHaR3+zdj+VSrnkMLIuoISEY//FA6YKh9gYep
nWSGFw3kiAo1Vsk=
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=-4.7 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Mon, 3 Aug 2015 15:46:02 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Cc: JonY <10walls AT gmail DOT com>
Subject: Re: wspiapi.h uses _N conflicting with ctype.h
Message-ID: <20150803134602.GC18434@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, JonY <10walls AT gmail DOT com>
References: <CAOC2fq-Gsqj3zZa-X+w_jHDdob0bO0iUSVk--PoGoj-YaiyQ4Q AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAOC2fq-Gsqj3zZa-X+w_jHDdob0bO0iUSVk--PoGoj-YaiyQ4Q@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)

--vOmOzSkFvhd7u8Ms
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Aug  3 04:17, Michael Enright wrote:
> Here's a reduction of a problem I had compiling v8:
>=20
> #include <ctype.h>
> #include "wspiapi.h"
> char array[5];
> __wspiapi_countof_helper(array);
>=20
> The reduction isn't realistic but the problem is real.
>=20
> On one hand, ctype.h uses _N and it is within its "rights" to do so as
> ctype.h is part of the standard library. The statement that uses _N
> initially is "#define _N 04", so _N enters the global space of defined
> macros.
>=20
> On the other hand the template __wspiapi_countof_helper uses _N as the
> name of one of its parameters. This usage is in the domain of strings
> that can be interpreted as references to macros by the preprocessor,
> so the _N gets interpreted by the post-preprocessor phases as 04,
> causing some distress.
>=20
> So... the win32 headers are free to use
> leading-underscore-capital-letter symbols or no?

It's unfortunate, but with their right, just like the std headers.

> Anyway, how can this be addressed?

The best result would be if you (or we) could convince the mingw-w64
guys not to use _N.  Jon?  Any chance you could apply a patch to use
_n with lower case n?

For the time being, you can push/pop the clashing macros prior to
including the problematic header(s):

  #include <ctype.h>
  #pragma push_macro ("_N")
  #undef _N
  #include <wspiapi.h>
  #pragma pop_macro("_N")


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--vOmOzSkFvhd7u8Ms
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVv3CaAAoJEPU2Bp2uRE+gDUoP/RS56NJzfPTtsfgd1Akw/98n
+gNiSOuLlkNHfTQbBjocwLCy/C6ZFVnuPmHTucPHOT1ykKWAy3YjYL8L+nUlrF2n
B+49kofMYyp6VZ4Bjvota26F/F5JAYZjzdSZScDnJMMUVOJEfsJZV6QgakXEk3rD
MJovwwq7zCqBguuawyUab1XPbyudqL5/iIEe6m+7mXTMQC14rs3HYqSGE2GssDRI
ehhn1Dk2L9R+f4jMmk7/Rp+Ht2/yuwidAakNNfVByrrlvuCFRDv14lkYvlEYz9pw
5rDJYoXiAya6P94Fz+XtNUAXzmAMeijgsmWssLnM+9wz0VOiMKUWCza7DSDF/XEH
/XZOogl/GLcYl0/rjXrW26zWIqMqz56EDEknJPCu/W1FGcO4gzaAdcwweppRI8K7
9s6dbHNa9Gn0+HGk2W4NBSxDchrZVKi0C8F8Bx4jlqMq/puRG0mCIzhBTcq3bk44
ZphYpUmEQnSwaG12meh9/lSZ0invD0cijM9aCFtrZQmCopI9+aSIU2EPrr3O/Iz+
44hRBzU/Z7xDJL0xsTg56X19LBIVmhqeh4aW/jVcuJYbduUC+kb2lvKXRKgaztvj
y4RG5MbGsakv9+sl/YPnMk4LaKgN+P9u1lS6gOju3EMqbkV45UiGkULoHH1Eijj/
S8m809IephMt0MU22FxG
=RTfs
-----END PGP SIGNATURE-----

--vOmOzSkFvhd7u8Ms--

- Raw text -


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