]> granicus.if.org Git - clang/commitdiff
lib/Headers/mm_malloc.h: Use __mingw_aligned_malloc() in _mm_malloc() on mingw.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 18 Jul 2011 11:13:50 +0000 (11:13 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 18 Jul 2011 11:13:50 +0000 (11:13 +0000)
By default, mingw does not have _mm_alloc() nor _aligned_malloc().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135388 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/mm_malloc.h

index ec9236204bb9349e55e44e98db99541989e6eae3..5fa17618722799972868f87e0eee52d5b55b3e5a 100644 (file)
@@ -53,7 +53,9 @@ _mm_malloc(size_t size, size_t align)
     align = sizeof(void *);
 
   void *mallocedMemory;
-#ifdef _WIN32
+#if defined(__MINGW32__)
+  mallocedMemory = __mingw_aligned_malloc(size, align);
+#elif defined(_WIN32)
   mallocedMemory = _aligned_malloc(size, align);
 #else
   if (posix_memalign(&mallocedMemory, align, size))