[libcxx-commits] [libcxx] [libc++] Don't use aligned_alloc on iOS versions before 13 (PR #110315)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 27 12:11:03 PDT 2024


https://github.com/Un1q32 created https://github.com/llvm/llvm-project/pull/110315

There's a check here to not use aligned_alloc on macOS versions before 10.15, this patch adds an equivalent check that tests for iOS 13.

>From b1b17210bcf9c664e6b38a845ee24fd425ce7b15 Mon Sep 17 00:00:00 2001
From: Un1q32 <joey.t.reinhart at gmail.com>
Date: Fri, 27 Sep 2024 15:06:15 -0400
Subject: [PATCH] [libc++] Don't use aligned_alloc on iOS versions before 13

---
 libcxx/include/__config | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libcxx/include/__config b/libcxx/include/__config
index f90c966aad6950..0d71264611ff66 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -649,6 +649,10 @@ typedef __char32_t char32_t;
          __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500)
 #      define _LIBCPP_HAS_NO_C11_ALIGNED_ALLOC
 #    endif
+#    if (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) &&                                                    \
+         __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000)
+#      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



More information about the libcxx-commits mailing list