[libc++] Remove support for Android 4 and older (#124062)

This commit is contained in:
Brad Smith 2025-01-23 04:27:26 -05:00 committed by GitHub
parent 9fd9263474
commit 6bc68d0fe9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 25 deletions

View File

@ -18,9 +18,6 @@ extern "C" {
}
#include <__cxx03/android/api-level.h>
#if __ANDROID_API__ < 21
# include <__cxx03/__support/xlocale/__posix_l_fallback.h>
#endif
// If we do not have this header, we are in a platform build rather than an NDK
// build, which will always be at least as new as the ToT NDK, in which case we
@ -30,9 +27,7 @@ extern "C" {
// In NDK versions later than 16, locale-aware functions are provided by
// legacy_stdlib_inlines.h
# if __NDK_MAJOR__ <= 16
# if __ANDROID_API__ < 21
# include <__cxx03/__support/xlocale/__strtonum_fallback.h>
# elif __ANDROID_API__ < 26
# if __ANDROID_API__ < 26
inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) {
return ::strtof(__nptr, __endptr);

View File

@ -18,9 +18,6 @@ extern "C" {
}
#include <android/api-level.h>
#if __ANDROID_API__ < 21
# include <__support/xlocale/__posix_l_fallback.h>
#endif
// If we do not have this header, we are in a platform build rather than an NDK
// build, which will always be at least as new as the ToT NDK, in which case we
@ -30,9 +27,7 @@ extern "C" {
// In NDK versions later than 16, locale-aware functions are provided by
// legacy_stdlib_inlines.h
# if __NDK_MAJOR__ <= 16
# if __ANDROID_API__ < 21
# include <__support/xlocale/__strtonum_fallback.h>
# elif __ANDROID_API__ < 26
# if __ANDROID_API__ < 26
inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) {
return ::strtof(__nptr, __endptr);

View File

@ -13,13 +13,8 @@
#include <cstdlib>
#ifdef __BIONIC__
# include <android/api-level.h>
# if __ANDROID_API__ >= 21
# include <syslog.h>
# include <syslog.h>
extern "C" void android_set_abort_message(const char* msg);
# else
# include <assert.h>
# endif // __ANDROID_API__ >= 21
#endif // __BIONIC__
#if defined(__APPLE__) && __has_include(<CrashReporterClient.h>)
@ -54,7 +49,6 @@ _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) _LIBCPP_VERBOS
#elif defined(__BIONIC__)
vasprintf(&buffer, format, list);
# if __ANDROID_API__ >= 21
// Show error in tombstone.
android_set_abort_message(buffer);
@ -62,12 +56,6 @@ _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) _LIBCPP_VERBOS
openlog("libc++", 0, 0);
syslog(LOG_CRIT, "%s", buffer);
closelog();
# else
// The good error reporting wasn't available in Android until L. Since we're
// about to abort anyway, just call __assert2, which will log _somewhere_
// (tombstone and/or logcat) in older releases.
__assert2(__FILE__, __LINE__, __func__, buffer);
# endif // __ANDROID_API__ >= 21
#endif
va_end(list);