Fix Libc++ build with MinGW64
Summary: This patch corrects the build errors I encountered when building on MinGW64. Reviewers: mati865, rnk, compnerd, smeenai, bcraig Reviewed By: mati865, smeenai Subscribers: martell, chapuni, cfe-commits Differential Revision: https://reviews.llvm.org/D33082 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -183,7 +183,7 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
|
||||
if (static_cast<size_t>(alignment) < sizeof(void*))
|
||||
alignment = std::align_val_t(sizeof(void*));
|
||||
void* p;
|
||||
#if defined(_LIBCPP_MSVCRT)
|
||||
#if defined(_LIBCPP_MSVCRT_LIKE)
|
||||
while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
|
||||
#else
|
||||
while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
|
||||
@@ -256,7 +256,7 @@ void
|
||||
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
|
||||
{
|
||||
if (ptr)
|
||||
#if defined(_LIBCPP_MSVCRT)
|
||||
#if defined(_LIBCPP_MSVCRT_LIKE)
|
||||
::_aligned_free(ptr);
|
||||
#else
|
||||
::free(ptr);
|
||||
|
||||
Reference in New Issue
Block a user