Don't use posix_memalign under MinGW
authorEric Fiselier <eric@efcs.ca>
Thu, 11 May 2017 02:01:05 +0000 (02:01 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 11 May 2017 02:01:05 +0000 (02:01 +0000)
llvm-svn: 302755

libcxxabi/src/stdlib_new_delete.cpp

index ffd174c..0e85f6a 100644 (file)
@@ -146,7 +146,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_WIN32API)
     while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
 #else
     while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
@@ -219,7 +219,7 @@ void
 operator delete(void* ptr, std::align_val_t) _NOEXCEPT
 {
     if (ptr)
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_WIN32API)
         ::_aligned_free(ptr);
 #else
         ::free(ptr);