diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -356,7 +356,6 @@ #if (defined(__ISO_C_VISIBLE) && (__ISO_C_VISIBLE >= 2011)) || __cplusplus >= 201103L # if defined(__FreeBSD__) -# define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_QUICK_EXIT # if __FreeBSD_version >= 1300064 || \ (__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000) @@ -366,18 +365,13 @@ # if __ANDROID_API__ >= 21 # define _LIBCPP_HAS_QUICK_EXIT # endif -# if __ANDROID_API__ >= 28 -# define _LIBCPP_HAS_ALIGNED_ALLOC -# endif # if __ANDROID_API__ >= 29 # define _LIBCPP_HAS_TIMESPEC_GET # endif # elif defined(__Fuchsia__) || defined(__wasi__) || defined(__NetBSD__) -# define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_QUICK_EXIT # define _LIBCPP_HAS_TIMESPEC_GET # elif defined(__OpenBSD__) -# define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_TIMESPEC_GET # elif defined(__linux__) # if !defined(_LIBCPP_HAS_MUSL_LIBC) @@ -385,11 +379,9 @@ # define _LIBCPP_HAS_QUICK_EXIT # endif # if _LIBCPP_GLIBC_PREREQ(2, 17) -# define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_TIMESPEC_GET # endif # else // defined(_LIBCPP_HAS_MUSL_LIBC) -# define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_QUICK_EXIT # define _LIBCPP_HAS_TIMESPEC_GET # endif @@ -403,7 +395,6 @@ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000) || \ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000) || \ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)) -# define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_TIMESPEC_GET # endif # endif // __APPLE__ diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib --- a/libcxx/include/cstdlib +++ b/libcxx/include/cstdlib @@ -154,7 +154,7 @@ using ::at_quick_exit _LIBCPP_USING_IF_EXISTS; using ::quick_exit _LIBCPP_USING_IF_EXISTS; #endif -#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_ALIGNED_ALLOC) +#if _LIBCPP_STD_VER > 14 using ::aligned_alloc _LIBCPP_USING_IF_EXISTS; #endif diff --git a/libcxx/test/libcxx/language.support/has_aligned_alloc.compile.pass.cpp b/libcxx/test/libcxx/language.support/has_aligned_alloc.compile.pass.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/language.support/has_aligned_alloc.compile.pass.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03, c++11, c++14 - -// Make sure TEST_HAS_ALIGNED_ALLOC (defined by the test suite) and -// _LIBCPP_HAS_ALIGNED_ALLOC (defined by libc++) stay in sync. - -#include <__config> -#include "test_macros.h" - -#if defined(TEST_HAS_ALIGNED_ALLOC) != defined(_LIBCPP_HAS_ALIGNED_ALLOC) -# error "TEST_HAS_ALIGNED_ALLOC and _LIBCPP_HAS_ALIGNED_ALLOC are out of sync" -#endif diff --git a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp --- a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp @@ -132,9 +132,8 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#if TEST_STD_VER > 14 && defined(TEST_HAS_ALIGNED_ALLOC) - static_assert((std::is_same::value), - ""); +#if TEST_STD_VER > 14 + static_assert((std::is_same::value), ""); #endif void* pv = 0; diff --git a/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp b/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp --- a/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp +++ b/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp @@ -119,9 +119,8 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#if TEST_STD_VER > 14 && defined(TEST_HAS_ALIGNED_ALLOC) - static_assert( - (std::is_same::value), ""); +#if TEST_STD_VER > 14 + static_assert((std::is_same::value), ""); #endif void* pv = 0; diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -172,21 +172,16 @@ (__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000) # define TEST_HAS_TIMESPEC_GET # endif -# define TEST_HAS_ALIGNED_ALLOC # define TEST_HAS_QUICK_EXIT # elif defined(__BIONIC__) # if __ANDROID_API__ >= 21 # define TEST_HAS_QUICK_EXIT # endif -# if __ANDROID_API__ >= 28 -# define TEST_HAS_ALIGNED_ALLOC -# endif # if __ANDROID_API__ >= 29 # define TEST_HAS_TIMESPEC_GET # endif # elif defined(__Fuchsia__) || defined(__wasi__) || defined(__NetBSD__) # define TEST_HAS_QUICK_EXIT -# define TEST_HAS_ALIGNED_ALLOC # define TEST_HAS_TIMESPEC_GET # elif defined(__linux__) // This block preserves the old behavior used by include/__config: @@ -198,12 +193,10 @@ # define TEST_HAS_QUICK_EXIT # endif # if TEST_GLIBC_PREREQ(2, 17) -# define TEST_HAS_ALIGNED_ALLOC # define TEST_HAS_TIMESPEC_GET # endif # elif defined(_LIBCPP_HAS_MUSL_LIBC) # define TEST_HAS_QUICK_EXIT -# define TEST_HAS_ALIGNED_ALLOC # define TEST_HAS_TIMESPEC_GET # endif # elif defined(_WIN32) @@ -218,7 +211,6 @@ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000) || \ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000) || \ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)) -# define TEST_HAS_ALIGNED_ALLOC # define TEST_HAS_TIMESPEC_GET # endif # endif // __APPLE__