From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6320 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Convert some is* macros to inline functions Date: Tue, 14 Oct 2014 12:34:27 -0400 Message-ID: <20141014163427.GP32028@brightrain.aerifal.cx> References: <20141013142020.GA26828@zx-spectrum.accesssoftek.com> <1413210914.4885.1174.camel@eris.loria.fr> <20141013180056.GA28588@zx-spectrum.accesssoftek.com> <20141013180622.GE32028@brightrain.aerifal.cx> <20141013184956.GA4874@port70.net> <20141014090108.GA2635@zx-spectrum> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1413304489 16368 80.91.229.3 (14 Oct 2014 16:34:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Oct 2014 16:34:49 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6333-gllmg-musl=m.gmane.org@lists.openwall.com Tue Oct 14 18:34:42 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Xe53Y-0000ad-Qc for gllmg-musl@plane.gmane.org; Tue, 14 Oct 2014 18:34:40 +0200 Original-Received: (qmail 23656 invoked by uid 550); 14 Oct 2014 16:35:33 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 23648 invoked from network); 14 Oct 2014 16:35:32 -0000 Content-Disposition: inline In-Reply-To: <20141014090108.GA2635@zx-spectrum> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6320 Archived-At: On Tue, Oct 14, 2014 at 12:01:08PM +0300, Sergey Dmitrouk wrote: > On Mon, Oct 13, 2014 at 11:49:56AM -0700, Szabolcs Nagy wrote: > > the c++ standard could be more explicit about this incompatibility > > with c: it states the requirement in a note for the headers > > and then defines the semantics for the headers in terms of > > the one > > Sad, but true. I wish it was stated better. > > > The only way to achieve equivalent inline behavior in C++ is to > > provide a definition as an extern inline function. > > Seems to be true, so newlib and glibc have checks for __cplusplus define. > Alternative would be to provide 26 fake headers containing #include_next > directive, but it's not very portable solution. > > Attached is the patch, which simply adds #ifndef __cplusplus around > macros. At the end, it seems to be the right thing to do, although the > way it's defined is rather confusing. Thanks. Committed with minor change (moved the inline function __isspace, which is unused without the macro, inside of the #ifndef). Rich