mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] Convert some is* macros to inline functions
Date: Tue, 14 Oct 2014 12:34:27 -0400	[thread overview]
Message-ID: <20141014163427.GP32028@brightrain.aerifal.cx> (raw)
In-Reply-To: <20141014090108.GA2635@zx-spectrum>

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 <cname> headers
> > and then defines the semantics for the <name.h> headers in terms of
> > the <cname> 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


      reply	other threads:[~2014-10-14 16:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13 14:20 Sergey Dmitrouk
2014-10-13 14:35 ` Jens Gustedt
2014-10-13 18:00   ` Sergey Dmitrouk
2014-10-13 18:06     ` Rich Felker
2014-10-13 18:49       ` Szabolcs Nagy
2014-10-14  9:01         ` Sergey Dmitrouk
2014-10-14 16:34           ` Rich Felker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141014163427.GP32028@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).