This is an archive of the discontinued LLVM Phabricator instance.

Replace __ANDROID__ with __BIONIC__.
ClosedPublic

Authored by danalbert on Sep 16 2016, 4:46 PM.

Details

Summary

None of these checks are specific to Android devices. If libc++ was
used with Bionic on a normal Linux system these checks would still be
needed.

Diff Detail

Repository
rL LLVM

Event Timeline

danalbert updated this revision to Diff 71714.Sep 16 2016, 4:46 PM
danalbert retitled this revision from to Replace __ANDROID__ with __BIONIC__..
danalbert updated this object.
danalbert added reviewers: EricWF, mclow.lists.
danalbert set the repository for this revision to rL LLVM.
danalbert added a subscriber: cfe-commits.

So, the only thing that Im confused about is where does __BIONIC__ get defined?

include/__config
766 ↗(On Diff #71714)

Not your fault, but _WIN32 and __unix__? Im not sure if MinGW or cygwin define both.

EricWF added inline comments.Sep 17 2016, 9:17 PM
include/__config
340 ↗(On Diff #71714)

What happened to this include? I believe it's needed to get __GLIBC_PREREQ.

So, the only thing that Im confused about is where does __BIONIC__ get defined?

It's in Bionic's <sys/cdefs.h>, which gets pulled in via <features.h>.

include/__config
340 ↗(On Diff #71714)

Included much earlier now (L90). We always needed this for Linux, and having it at the top of the file means we won't accidentally forget to include it for an earlier check.

766 ↗(On Diff #71714)

That is odd. I would assume that _WIN32 implies !__unix__.

EricWF accepted this revision.Sep 18 2016, 10:43 PM
EricWF edited edge metadata.

LGTM after addressing the MUSL libc comment.

include/__config
90 ↗(On Diff #71714)

Does MUSL libc have a features.h? This include was previously guarded by if !defined(_LIBCPP_HAS_MUSL_LIBC).

This revision is now accepted and ready to land.Sep 18 2016, 10:43 PM
This revision was automatically updated to reflect the committed changes.