Skip to content

Commit 6bc68d0

Browse files
authored
[libc++] Remove support for Android 4 and older (#124062)
1 parent 9fd9263 commit 6bc68d0

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

libcxx/include/__cxx03/__locale_dir/locale_base_api/android.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ extern "C" {
1818
}
1919

2020
#include <__cxx03/android/api-level.h>
21-
#if __ANDROID_API__ < 21
22-
# include <__cxx03/__support/xlocale/__posix_l_fallback.h>
23-
#endif
2421

2522
// If we do not have this header, we are in a platform build rather than an NDK
2623
// build, which will always be at least as new as the ToT NDK, in which case we
@@ -30,9 +27,7 @@ extern "C" {
3027
// In NDK versions later than 16, locale-aware functions are provided by
3128
// legacy_stdlib_inlines.h
3229
# if __NDK_MAJOR__ <= 16
33-
# if __ANDROID_API__ < 21
34-
# include <__cxx03/__support/xlocale/__strtonum_fallback.h>
35-
# elif __ANDROID_API__ < 26
30+
# if __ANDROID_API__ < 26
3631

3732
inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) {
3833
return ::strtof(__nptr, __endptr);

libcxx/include/__locale_dir/locale_base_api/android.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ extern "C" {
1818
}
1919

2020
#include <android/api-level.h>
21-
#if __ANDROID_API__ < 21
22-
# include <__support/xlocale/__posix_l_fallback.h>
23-
#endif
2421

2522
// If we do not have this header, we are in a platform build rather than an NDK
2623
// build, which will always be at least as new as the ToT NDK, in which case we
@@ -30,9 +27,7 @@ extern "C" {
3027
// In NDK versions later than 16, locale-aware functions are provided by
3128
// legacy_stdlib_inlines.h
3229
# if __NDK_MAJOR__ <= 16
33-
# if __ANDROID_API__ < 21
34-
# include <__support/xlocale/__strtonum_fallback.h>
35-
# elif __ANDROID_API__ < 26
30+
# if __ANDROID_API__ < 26
3631

3732
inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) {
3833
return ::strtof(__nptr, __endptr);

libcxx/src/verbose_abort.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@
1313
#include <cstdlib>
1414

1515
#ifdef __BIONIC__
16-
# include <android/api-level.h>
17-
# if __ANDROID_API__ >= 21
18-
# include <syslog.h>
16+
# include <syslog.h>
1917
extern "C" void android_set_abort_message(const char* msg);
20-
# else
21-
# include <assert.h>
22-
# endif // __ANDROID_API__ >= 21
2318
#endif // __BIONIC__
2419

2520
#if defined(__APPLE__) && __has_include(<CrashReporterClient.h>)
@@ -54,20 +49,13 @@ _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) _LIBCPP_VERBOS
5449
#elif defined(__BIONIC__)
5550
vasprintf(&buffer, format, list);
5651

57-
# if __ANDROID_API__ >= 21
5852
// Show error in tombstone.
5953
android_set_abort_message(buffer);
6054

6155
// Show error in logcat.
6256
openlog("libc++", 0, 0);
6357
syslog(LOG_CRIT, "%s", buffer);
6458
closelog();
65-
# else
66-
// The good error reporting wasn't available in Android until L. Since we're
67-
// about to abort anyway, just call __assert2, which will log _somewhere_
68-
// (tombstone and/or logcat) in older releases.
69-
__assert2(__FILE__, __LINE__, __func__, buffer);
70-
# endif // __ANDROID_API__ >= 21
7159
#endif
7260
va_end(list);
7361

0 commit comments

Comments
 (0)