[libcxx-commits] [libcxx] [libcxxabi] [libc++][RFC] Always define internal feature test macros (PR #89178)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 19 09:22:43 PDT 2024


================
@@ -103,16 +103,22 @@ void  operator delete[](void* ptr, void*) noexcept;
 #  pragma GCC system_header
 #endif
 
-#if !defined(__cpp_sized_deallocation) || __cpp_sized_deallocation < 201309L
-#  define _LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION
+#if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
+#  define _LIBCPP_HAS_LANGUAGE_SIZED_DEALLOCATION 1
+#else
+#  define _LIBCPP_HAS_LANGUAGE_SIZED_DEALLOCATION 0
 #endif
 
-#if !defined(_LIBCPP_BUILDING_LIBRARY) && _LIBCPP_STD_VER < 14 && defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION)
-#  define _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION
+#if _LIBCPP_STD_VER >= 14 || _LIBCPP_HAS_LANGUAGE_SIZED_DEALLOCATION
----------------
ldionne wrote:

This is a great example of why this change matters. The "before" code is absolutely impossible to understand, and the "after" code (which is equivalent) is a lot simpler.

https://github.com/llvm/llvm-project/pull/89178


More information about the libcxx-commits mailing list