[libc++] Tolerate presence of __deallocate macro

Summary:
On Windows the identifier `__deallocate` is defined as a macro by one of the Windows system headers. Previously libc++ worked around this by `#undef __deallocate` and generating a warning. However this causes the WIN32 version of `__threading_support` to always generate a warning on Windows. This is not OK.

This patch renames all usages of `__deallocate` internally as to not conflict with the macro.

Reviewers: mclow.lists, majnemer, rnk, rsmith, smeenai, compnerd

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28426

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291332 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-01-07 03:01:24 +00:00
parent cc1d780758
commit 32b19c3d9f
9 changed files with 21 additions and 52 deletions

View File

@@ -348,7 +348,6 @@ template <class T> unspecified2 end(const valarray<T>& v);
#include <new>
#include <__undef_min_max>
#include <__undef___deallocate>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -3697,7 +3696,7 @@ valarray<_Tp>::resize(size_t __n, value_type __x)
{
while (__end_ != __begin_)
(--__end_)->~value_type();
_VSTD::__deallocate(__begin_);
_VSTD::__libcpp_deallocate(__begin_);
__begin_ = __end_ = nullptr;
}
if (__n)