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
llvm-svn: 304360
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 1ec026252b3027f06c8a561d93fc0a3801107bba
diff --git a/src/new.cpp b/src/new.cpp
index 21b3074..2b2682f 100644
--- a/src/new.cpp
+++ b/src/new.cpp
@@ -183,7 +183,7 @@
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 @@
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);