[libcxx-commits] [libcxx] 49c8f90 - [libc++] Fix aligned_alloc usage for Android
Shoaib Meenai via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 10 06:26:04 PST 2023
Author: Shoaib Meenai
Date: 2023-01-10T06:25:50-08:00
New Revision: 49c8f903efea3e31cca115d4bc2ebb00b6463d7f
URL: https://github.com/llvm/llvm-project/commit/49c8f903efea3e31cca115d4bc2ebb00b6463d7f
DIFF: https://github.com/llvm/llvm-project/commit/49c8f903efea3e31cca115d4bc2ebb00b6463d7f.diff
LOG: [libc++] Fix aligned_alloc usage for Android
Android only provides this function on API 28+; fix libc++ builds when
targeting older API levels.
Reviewed By: arichardson, #libc, philnik
Differential Revision: https://reviews.llvm.org/D141184
Added:
Modified:
libcxx/include/__config
Removed:
################################################################################
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 1a519b9f44d1c..505ccf95de724 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -741,6 +741,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500)
# define _LIBCPP_HAS_NO_C11_ALIGNED_ALLOC
# endif
+# elif defined(__ANDROID__) && __ANDROID_API__ < 28
+// Android only provides aligned_alloc when targeting API 28 or higher.
+# define _LIBCPP_HAS_NO_C11_ALIGNED_ALLOC
# endif
# if defined(__APPLE__) || defined(__FreeBSD__)
More information about the libcxx-commits
mailing list