From 6bc68d0fe94e7fbdec40e1306bf8db1b0db3110c Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Thu, 23 Jan 2025 04:27:26 -0500 Subject: [PATCH] [libc++] Remove support for Android 4 and older (#124062) --- .../__cxx03/__locale_dir/locale_base_api/android.h | 7 +------ .../include/__locale_dir/locale_base_api/android.h | 7 +------ libcxx/src/verbose_abort.cpp | 14 +------------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/libcxx/include/__cxx03/__locale_dir/locale_base_api/android.h b/libcxx/include/__cxx03/__locale_dir/locale_base_api/android.h index 265dbf892a54..e96e64d98164 100644 --- a/libcxx/include/__cxx03/__locale_dir/locale_base_api/android.h +++ b/libcxx/include/__cxx03/__locale_dir/locale_base_api/android.h @@ -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); diff --git a/libcxx/include/__locale_dir/locale_base_api/android.h b/libcxx/include/__locale_dir/locale_base_api/android.h index 08ef5407dedf..36b8d93e1b22 100644 --- a/libcxx/include/__locale_dir/locale_base_api/android.h +++ b/libcxx/include/__locale_dir/locale_base_api/android.h @@ -18,9 +18,6 @@ extern "C" { } #include -#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); diff --git a/libcxx/src/verbose_abort.cpp b/libcxx/src/verbose_abort.cpp index 6704709d247c..fd6bc4943d6b 100644 --- a/libcxx/src/verbose_abort.cpp +++ b/libcxx/src/verbose_abort.cpp @@ -13,13 +13,8 @@ #include #ifdef __BIONIC__ -# include -# if __ANDROID_API__ >= 21 -# include +# include extern "C" void android_set_abort_message(const char* msg); -# else -# include -# endif // __ANDROID_API__ >= 21 #endif // __BIONIC__ #if defined(__APPLE__) && __has_include() @@ -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);