This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by thomasanderson on Oct 31 2017, 2:45 PM.

Details

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__.

Diff Detail

Repository
rL LLVM

Event Timeline

thomasanderson created this revision.Oct 31 2017, 2:45 PM
thomasanderson edited the summary of this revision. (Show Details)Oct 31 2017, 2:51 PM
danalbert edited edge metadata.Oct 31 2017, 3:09 PM

I'm wondering how you came across this as an issue. libc++ with the NDK needs to be accompanied by libandroid_support, which provides a decl (though not a definition) for this. I prefer this approach, but was under the impression that all of the hacks for "this wasn't in bionic until three years ago, and that still matters" weren't wanted upstream.

include/__config
301 ↗(On Diff #121066)

This should maybe be a __has_include, since bionic isn't only for Android these days.

thomasanderson marked an inline comment as done.
danalbert accepted this revision.Nov 1 2017, 1:19 PM
This revision is now accepted and ready to land.Nov 1 2017, 1:19 PM
This revision was automatically updated to reflect the committed changes.