This is an archive of the discontinued LLVM Phabricator instance.

[Reland] [libc++] Don't alias quick_exit if __ANDROID_API__ < 21
AbandonedPublic

Authored by thomasanderson on Nov 3 2017, 11:07 AM.

Details

Reviewers
danalbert
EricWF
Summary

quick_exit() and at_quick_exit() were introduced in android NDK 21:
https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/stdlib.h#55

This CL conditions _LIBCPP_HAS_QUICK_EXIT on __ANDROID_API__ >= 21. The only place this macro is used is in some using declarations: using ::quick_exit, using ::at_quick_exit.

Also, add a missing include to sys/cdefs.h which is what defines __BIONIC__.

This is a reland of r317124, which caused a circular dependency on Darwin due to the <sys/cdefs.h> include. The solution is to only include this header on Linux.

Diff Detail

Event Timeline

thomasanderson created this revision.Nov 3 2017, 11:07 AM
thomasanderson edited the summary of this revision. (Show Details)Nov 3 2017, 11:07 AM

danalbert@ ptal.

It seems I ran into this bug https://bugs.llvm.org/show_bug.cgi?id=25341
But, I was unable to reproduce the issue when building on a Mac machine, so I'm not 100% sure it's fixed. Is there a way to run the Darwin bot on this CL? Also, I'm not sure if the __libcpp_has_include is necessary any more.

EricWF accepted this revision.Nov 6 2017, 6:24 PM

LGTM.

This revision is now accepted and ready to land.Nov 6 2017, 6:24 PM
thomasanderson abandoned this revision.Dec 27 2018, 12:34 PM