[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
Tue May 15 11:18:26 PDT 2018


danalbert added inline comments.


================
Comment at: include/__locale:27
 #elif defined(__ANDROID__)
-# include <support/android/locale_bionic.h>
+// Android gained the locale aware functions in L (API level 21)
+# include <android/api-level.h>
----------------
Except when it gained them in 26. `strtof_l`, `strtod_l`, and `strtol_l` are all needed until `__ANDROID_API__ >= 26`. I don't think this patch works if you're targeting `21 <= __ANDROID_API__ < 26`.


================
Comment at: include/support/android/locale_bionic.h:30
 #include <support/xlocale/__posix_l_fallback.h>
+#if __NDK_MAJOR__ <= 16
+#include <support/xlocale/__strtonum_fallback.h>
----------------
Probably deserves a comment.


https://reviews.llvm.org/D46558





More information about the llvm-commits mailing list