diff options
author | Eric Fiselier <eric@efcs.ca> | 2018-10-11 00:17:24 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2018-10-11 00:17:24 +0000 |
commit | 657a13025cf596ec7f683eb9310c75c965ba64b3 (patch) | |
tree | a9c992c1bb805db71ad3c7a38b3644611434c08b /src | |
parent | b5d4ffd60d53c850ad0077d3950a136d0b475f03 (diff) | |
download | libcxx-657a13025cf596ec7f683eb9310c75c965ba64b3.tar.gz |
Distinguish between library and language support for aligned allocation.
There are two cases:
1. The library has all it needs to provide align_val_t and the
new/delete overloads needed to support aligned allocation.
2. The compiler has actually turned the language feature on.
There are times where libc++ needs to distinguish between the two.
This patch adds the additional macro
_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION which denotes when case (1)
does not hold. _LIBCPP_HAS_NO_ALIGNED_ALLOCATION is defined whenever
_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION is defined, or when the
compiler has not enabled the language feature.
Additionally this patch cleans up a number of other macros related
to detection of aligned allocation machinery.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src')
-rw-r--r-- | src/new.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/new.cpp b/src/new.cpp index 35f481db0..cc8383d4f 100644 --- a/src/new.cpp +++ b/src/new.cpp @@ -55,7 +55,7 @@ __throw_bad_alloc() } // std #if !defined(__GLIBCXX__) && \ - (!defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME)) && \ + !defined(_LIBCPP_DEFER_NEW_TO_VCRUNTIME) && \ !defined(_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS) // Implement all new and delete operators as weak definitions @@ -173,7 +173,7 @@ operator delete[] (void* ptr, size_t) _NOEXCEPT ::operator delete[](ptr); } -#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) +#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) _LIBCPP_WEAK void * @@ -298,5 +298,5 @@ operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT ::operator delete[](ptr, alignment); } -#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION +#endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION #endif // !__GLIBCXX__ && (!_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME) && !_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS |