Skip to content
0.2.0-dev Download ZIP
40 lines ·1.1 KB Raw
1diff --git a/thirdparty/embree/common/simd/arm/sse2neon.h b/thirdparty/embree/common/simd/arm/sse2neon.h
2index b18d41e783..5a75ccff20 100644
3--- a/thirdparty/embree/common/simd/arm/sse2neon.h
4+++ b/thirdparty/embree/common/simd/arm/sse2neon.h
5@@ -102,7 +102,7 @@
6 #include <stdint.h>
7 #include <stdlib.h>
8
9-#if defined(_WIN32)
10+#if defined(_WIN32) && !defined(__MINGW32__)
11 /* Definitions for _mm_{malloc,free} are provided by <malloc.h>
12 * from both MinGW-w64 and MSVC.
13 */
14@@ -1888,7 +1888,11 @@ FORCE_INLINE __m128 _mm_div_ss(__m128 a, __m128 b)
15 #if !defined(SSE2NEON_ALLOC_DEFINED)
16 FORCE_INLINE void _mm_free(void *addr)
17 {
18+#if defined(_WIN32)
19+ _aligned_free(addr);
20+#else
21 free(addr);
22+#endif
23 }
24 #endif
25
26@@ -2080,8 +2084,14 @@ FORCE_INLINE void *_mm_malloc(size_t size, size_t align)
27 return malloc(size);
28 if (align == 2 || (sizeof(void *) == 8 && align == 4))
29 align = sizeof(void *);
30+#if defined(_WIN32)
31+ ptr = _aligned_malloc(size, align);
32+ if (ptr)
33+ return ptr;
34+#else
35 if (!posix_memalign(&ptr, align, size))
36 return ptr;
37+#endif
38 return NULL;
39 }
40 #endif