[llvm-branch-commits] [libcxx] 566d1f3 - Fix CtsDeqpTestCases failures

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 24 17:57:17 PDT 2022


Author: zijunzhao
Date: 2022-03-28T16:26:29Z
New Revision: 566d1f3a3e1e15fe540b4bbda0fe2fb06e54d94c

URL: https://github.com/llvm/llvm-project/commit/566d1f3a3e1e15fe540b4bbda0fe2fb06e54d94c
DIFF: https://github.com/llvm/llvm-project/commit/566d1f3a3e1e15fe540b4bbda0fe2fb06e54d94c.diff

LOG: Fix CtsDeqpTestCases failures

Bug: None
Test: None
Change-Id: I370f5b4348cc2aad906a37bdeb9204d2aa4b05ea

Added: 
    

Modified: 
    libcxx/include/__support/android/locale_bionic.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__support/android/locale_bionic.h b/libcxx/include/__support/android/locale_bionic.h
index 8c6d4bd0dc322..c02e2718477d2 100644
--- a/libcxx/include/__support/android/locale_bionic.h
+++ b/libcxx/include/__support/android/locale_bionic.h
@@ -30,6 +30,19 @@ extern "C" {
 #if __ANDROID_API__ < 21
 #include <__support/xlocale/__posix_l_fallback.h>
 #endif
+
+// HACK: Not in upstream NDK or libc++.
+// Upstream now supports using ToT libc++ with old NDKs, but as such it is now
+// *only* compatible with the NDK. That will need to be fixed both for the
+// platorm and for the NDK-in-platform use case since neither has
+// android/ndk-version.h.
+
+// 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
 #if __NDK_MAJOR__ <= 16
@@ -63,6 +76,7 @@ inline _LIBCPP_INLINE_VISIBILITY long strtol_l(const char* __nptr, char** __endp
 #endif // __ANDROID_API__ < 26
 
 #endif // __NDK_MAJOR__ <= 16
+#endif // __has_include(<android/ndk-version.h>)
 #endif // defined(__ANDROID__)
 
 #endif // defined(__BIONIC__)


        


More information about the llvm-branch-commits mailing list