[PATCH] D46558: Condition usage of locale stdlib functions on Android API version

Dan Albert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 9 11:41:01 PDT 2018


danalbert added inline comments.


================
Comment at: libcxx/trunk/include/support/android/locale_bionic.h:30
 #include <android/api-level.h>
-
-// Android gained most locale aware functions in L (API level 21)
-#if __ANDROID_API__ < 21
+#include <android/ndk-version.h>
 #include <support/xlocale/__posix_l_fallback.h>
----------------
pcc wrote:
> eugenis wrote:
> > This requires NDK r16 or higher, the header is not present in r15.
> > I'm now updating the buildbot to r16, but I imagine not all users can upgrade easily.
> > Is there a way to preserve compatibility with older releases?
> > 
> I guess we could use the `__libcpp_has_include` macro here. If the header is not present, we can assume that the NDK version is old.
That will conflict with a (not yet upstreamed) patch that we needed to get this to build in AOSP: https://android-review.googlesource.com/c/platform/external/libcxx/+/709923.

There isn't a good a way to differentiate between Android platform and pre-r16 NDK that I know of.

Has chrome updated to r17 yet? When they do we can just revert this patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D46558





More information about the llvm-commits mailing list