[lldb-dev] Pre-processor definition confusion

Zachary Turner zturner at google.com
Fri Sep 12 09:59:33 PDT 2014

The important thing seems to be whether glibc implies linux, not the other
way around.  If glibc implies linux, then

#if defined(__linux__) || defined(__GLIBC__)

can be reduced to

#if defined(__linux__)

The issue is that all of our CMake decisions are based on OS platform.  If
I want to conditionally compile an entire file based on one of these
conditions, I need to translate it into something that fits well into the
CMake build.

On Thu, Sep 11, 2014 at 9:01 PM, Reid Kleckner <rnk at google.com> wrote:

> On Thu, Sep 11, 2014 at 7:07 PM, Zachary Turner <zturner at google.com>
> wrote:
>> Thanks.  In some places we check __GLIBC__ explicitly.  I guess what I'm
>> wondering is: is there some reason this isn't equivalent to some
>> combination of OS define checks?
> You can use alternative libcs on Linux, like musl:
> http://www.musl-libc.org/
> Android, for example, uses a Linux kernel with the Bionic libc
> implementation, so it's complicated. =/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140912/53e2cf7a/attachment.html>

More information about the lldb-dev mailing list