Skip to content

Conversation

Un1q32
Copy link
Contributor

@Un1q32 Un1q32 commented Sep 3, 2025

The only place this macro was used was in __memory/aligned_alloc.h, but the code that used this macro also checked for C++17 so it was removed, now this macro is never used.

@Un1q32 Un1q32 requested a review from a team as a code owner September 3, 2025 07:24
@frederick-vs-ja frederick-vs-ja added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 3, 2025
@philnik777 philnik777 changed the title remove unused macro in c++03 header [libc++] remove unused macro in c++03 header Sep 3, 2025
@philnik777 philnik777 changed the title [libc++] remove unused macro in c++03 header [libc++][C++03] remove unused macro in c++03 header Sep 3, 2025
@philnik777 philnik777 changed the title [libc++][C++03] remove unused macro in c++03 header [libc++][C++03] remove unused macro in __config Sep 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 3, 2025

@llvm/pr-subscribers-libcxx

Author: None (Un1q32)

Changes

The only place this macro was used was in __memory/aligned_alloc.h, but the code that used this macro also checked for C++17 so it was removed, now this macro is never used.


Full diff: https://github.com/llvm/llvm-project/pull/156609.diff

1 Files Affected:

  • (modified) libcxx/include/__cxx03/__config (-12)
diff --git a/libcxx/include/__cxx03/__config b/libcxx/include/__cxx03/__config
index 9b88a495055ee..d574eab8a12b1 100644
--- a/libcxx/include/__cxx03/__config
+++ b/libcxx/include/__cxx03/__config
@@ -622,18 +622,6 @@ typedef __char32_t char32_t;
 #    define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
 #  endif
 
-// It is not yet possible to use aligned_alloc() on all Apple platforms since
-// 10.15 was the first version to ship an implementation of aligned_alloc().
-#  if defined(__APPLE__)
-#    if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&                                                     \
-         __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__)
 #    define _LIBCPP_HAS_DEFAULTRUNELOCALE
 #  endif

@Un1q32
Copy link
Contributor Author

Un1q32 commented Sep 3, 2025

(I don't have merge access btw so if someone could merge this for me that would be very appreciated)

@philnik777 philnik777 merged commit 9c7727c into llvm:main Sep 3, 2025
61 of 81 checks passed
@Un1q32 Un1q32 deleted the cxx03-dead-code branch September 3, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants