[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
Wed May 16 15:43:58 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL332543: Condition usage of locale stdlib functions on Android API version (authored by pcc, committed by ).
Herald added a subscriber: christof.

Changed prior to commit:
  https://reviews.llvm.org/D46558?vs=146928&id=147206#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46558

Files:
  libcxx/trunk/include/support/android/locale_bionic.h


Index: libcxx/trunk/include/support/android/locale_bionic.h
===================================================================
--- libcxx/trunk/include/support/android/locale_bionic.h
+++ libcxx/trunk/include/support/android/locale_bionic.h
@@ -27,14 +27,14 @@
 #if defined(__ANDROID__)
 
 #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>
-#endif
-
-// The strto* family was added in O (API Level 26)
-#if __ANDROID_API__ < 26
+// 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 defined(__cplusplus)
 extern "C" {
@@ -61,6 +61,7 @@
 
 #endif // __ANDROID_API__ < 26
 
+#endif // __NDK_MAJOR__ <= 16
 #endif // defined(__ANDROID__)
 
 #endif // defined(__BIONIC__)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46558.147206.patch
Type: text/x-patch
Size: 1011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180516/3e703e13/attachment.bin>


More information about the llvm-commits mailing list