summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2023-10-05 21:13:33 +0000
committerElliott Hughes <enh@google.com>2023-10-05 21:13:33 +0000
commit847f38316899c1ce01353ecefd2a1bc71a12be5e (patch)
tree9a6646dc569e7ab142df062dc488fa4b23903326
parentd3d779a3ff888d72ee401bcfda78c10a9b8f1f28 (diff)
downloadlibcxx-847f38316899c1ce01353ecefd2a1bc71a12be5e.tar.gz
Backport https://reviews.llvm.org/D69983.
I want to clean up <ctype.h> now that API levels before 21 are no longer supported, but -- although upstream libc++ is fine -- our old libc++ unconditionally defines inlines for these functions, which collide with my attempt to do the same in bionic. Rather than keep waiting for the new libc++, backport this trivial fix. Test: treehugger Change-Id: I579a16ee3c4877d5033a0e4166f49d76af3a093b
-rw-r--r--include/support/android/locale_bionic.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/support/android/locale_bionic.h b/include/support/android/locale_bionic.h
index ee209ecb5..1f9c9b040 100644
--- a/include/support/android/locale_bionic.h
+++ b/include/support/android/locale_bionic.h
@@ -26,14 +26,15 @@ extern "C" {
#if defined(__ANDROID__)
+#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
// don't need any of the inlines below since libc provides them.
#if __has_include(<android/ndk-version.h>)
-
-#include <android/api-level.h>
#include <android/ndk-version.h>
// In NDK versions later than 16, locale-aware functions are provided by
// legacy_stdlib_inlines.h