From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55911 invoked by alias); 14 Jun 2017 08:48:49 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 55810 invoked by uid 89); 14 Jun 2017 08:48:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Jun 2017 08:48:39 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 25F52201FB for ; Wed, 14 Jun 2017 08:48:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 25F52201FB Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vinschen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 25F52201FB Received: from calimero.vinschen.de (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5CF878369 for ; Wed, 14 Jun 2017 08:48:42 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 53B73A80706; Wed, 14 Jun 2017 10:48:42 +0200 (CEST) Date: Wed, 14 Jun 2017 08:48:00 -0000 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH] stdio.h: guard function macros with !__cplusplus Message-ID: <20170614084842.GQ13513@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20170613200022.5056-1-yselkowi@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rwgQ89ZNnFUwFHTC" Content-Disposition: inline In-Reply-To: <20170613200022.5056-1-yselkowi@redhat.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-SW-Source: 2017/txt/msg00415.txt.bz2 --rwgQ89ZNnFUwFHTC Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1289 On Jun 13 15:00, Yaakov Selkowitz wrote: > While POSIX allows these functions to also be defined as macros in C, in > C++ this is not allowed, and prevents these names (particularly feof) from > being used in a custom namespace. >=20 > Signed-off-by: Yaakov Selkowitz > --- > newlib/libc/include/stdio.h | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h > index 097b0f665..1c32423d3 100644 > --- a/newlib/libc/include/stdio.h > +++ b/newlib/libc/include/stdio.h > @@ -718,6 +718,7 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, i= nt _c, FILE *_p) { > #define __sclearerr(p) ((void)((p)->_flags &=3D ~(__SERR|__SEOF))) > #define __sfileno(p) ((p)->_file) >=20=20 > +#ifndef __cplusplus > #ifndef _REENT_SMALL > #define feof(p) __sfeof(p) > #define ferror(p) __sferror(p) > @@ -740,6 +741,7 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, i= nt _c, FILE *_p) { > #define putc(x, fp) __sputc_r(_REENT, x, fp) > #endif /* lint */ > #endif /* __CYGWIN__ */ > +#endif /* __cplusplus */ >=20=20 > #if __MISC_VISIBLE > /* fast always-buffered version, true iff error */ > --=20 > 2.12.3 ACK to both patches. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --rwgQ89ZNnFUwFHTC Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZQPhqAAoJEPU2Bp2uRE+gp7YP/3+k7eMC6JFQLGRL69BjFVDq uqwjtQeevgWPaqzPWFw92V885WhFMknHVr7/pCnNx0aD5OCrp5v1T7jDEMBpjiku sAHxQyMOPFhkEIbwfUf7KhUD1MsOaVsDc4PaQAPGalWgzL+gXEbJX7MV6bgMT+d3 0mu/Lf7pNI1ITwUyllp6Aj5xnpYu6x+c3T6KFH4bm6TsqRSu+Zqms7d+ZJ7uJ4Tq jraAd609ZcRhyCm+qdppC1JWonnlsMa4phhaAmOC9p+H+oqsuveZYzfsDiyZn8ZU myfMl4coOSICmkkT1e7H2+EzFUevI2S+WBJBjTlO4Eny9S+VfRXzddAdHCpNOh2y mY3/M0MQeUWjzAEQGNPdWAxGX/7un0Bx5iBlW8J+O/JE9aMDHVB2JnrXyR7sDxEX GLnqgMuphpxYjQpz24kd9Dgo3sb8ZoGmwvdwbCpKsVuqFTVSLeg6Y+ugcsc/pTrx 6CocFORJle75Lfr0kUwmDdILyqMbtIUcoUBMOy6Nuiiou8ByhZ1ZLtjIs79fdkOe m8B9WGz028h9N9nr7beXwBuEZRwnitBm1EG79Eyum93gLMoWQsU99YVVv3c4JrSQ T+vS1O/7DwrC0KX8zBkYJh4OpW9OQQHFwKx3ckfowITSzpyHPqGFTPx0FwrLf+9o 5mGj2C57W5S9LivZ2hH4 =2HTc -----END PGP SIGNATURE----- --rwgQ89ZNnFUwFHTC--