Date: Tue, 14 Oct 2014 12:01:08 +0300 From: Sergey Dmitrouk <sdmitrouk@...esssoftek.com> To: "musl@...ts.openwall.com" <musl@...ts.openwall.com> Subject: Re: [PATCH] Convert some is* macros to inline functions 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, Sergey View attachment "musl-hide-is-macros-for-cxx.patch" of type "text/plain" (1524 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.