Path: blob/master/thirdparty/embree/patches/0005-mingw-llvm-arm64.patch
9904 views
diff --git a/thirdparty/embree/common/simd/arm/sse2neon.h b/thirdparty/embree/common/simd/arm/sse2neon.h1index b18d41e783..5a75ccff20 1006442--- a/thirdparty/embree/common/simd/arm/sse2neon.h3+++ b/thirdparty/embree/common/simd/arm/sse2neon.h4@@ -102,7 +102,7 @@5#include <stdint.h>6#include <stdlib.h>78-#if defined(_WIN32)9+#if defined(_WIN32) && !defined(__MINGW32__)10/* Definitions for _mm_{malloc,free} are provided by <malloc.h>11* from both MinGW-w64 and MSVC.12*/13@@ -1888,7 +1888,11 @@ FORCE_INLINE __m128 _mm_div_ss(__m128 a, __m128 b)14#if !defined(SSE2NEON_ALLOC_DEFINED)15FORCE_INLINE void _mm_free(void *addr)16{17+#if defined(_WIN32)18+ _aligned_free(addr);19+#else20free(addr);21+#endif22}23#endif2425@@ -2080,8 +2084,14 @@ FORCE_INLINE void *_mm_malloc(size_t size, size_t align)26return malloc(size);27if (align == 2 || (sizeof(void *) == 8 && align == 4))28align = sizeof(void *);29+#if defined(_WIN32)30+ ptr = _aligned_malloc(size, align);31+ if (ptr)32+ return ptr;33+#else34if (!posix_memalign(&ptr, align, size))35return ptr;36+#endif37return NULL;38}39#endif404142