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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 14:07:18 PDT 2018


pcc 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>
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D46558





More information about the llvm-commits mailing list