Skip to content
Snippets Groups Projects
Commit d91e21ae authored by Steve Lhomme's avatar Steve Lhomme
Browse files

compat: always use _aligned_malloc/_aligned_free on Windows

We don't need the mingw custom code. It's available in msvcrt.dll and UCRT. It's better
to use the same code between mingw and MSVC builds.
parent 6c687c20
No related branches found
No related tags found
Loading
Pipeline #330174 passed with stage
in 20 minutes and 14 seconds
......@@ -56,9 +56,7 @@ void *aligned_alloc(size_t align, size_t size)
#elif defined(HAVE_MEMALIGN)
return memalign(align, size);
#elif defined (_WIN32) && defined(__MINGW32__)
return __mingw_aligned_malloc(size, align);
#elif defined (_WIN32) && defined(_MSC_VER)
#elif defined (_WIN32)
return _aligned_malloc(size, align);
#else
/* align must be valid/supported */
......
......@@ -396,9 +396,7 @@ void *aligned_alloc(size_t, size_t);
} /* extern "C" */
#endif
#if defined (_WIN32) && defined(__MINGW32__)
#define aligned_free(ptr) __mingw_aligned_free(ptr)
#elif defined (_WIN32) && defined(_MSC_VER)
#if defined (_WIN32)
#define aligned_free(ptr) _aligned_free(ptr)
#else
#define aligned_free(ptr) free(ptr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment