Fix compilation error with MSVC C++

This commit is contained in:
daan 2019-07-07 21:59:53 -07:00
parent 7e743dfb58
commit 7f0137a617
5 changed files with 22 additions and 11 deletions

View file

@ -489,6 +489,7 @@ void* mi_new(std::size_t n) noexcept(false) {
else return mi_new_try(n);
}
#if (__cplusplus > 201402L || defined(__cpp_aligned_new))
// for aligned allocation its fine as it is not inlined anyways
void* mi_new_aligned(std::size_t n, std::align_val_t alignment) noexcept(false) {
void* p;
@ -500,5 +501,6 @@ void* mi_new_aligned(std::size_t n, std::align_val_t alignment) noexcept(false)
};
return p;
}
#endif
#endif

View file

@ -56,7 +56,7 @@ static inline uint8_t mi_bsr32(uint32_t x);
#include <intrin.h>
static inline uint8_t mi_bsr32(uint32_t x) {
uint32_t idx;
_BitScanReverse(&idx, x);
_BitScanReverse((DWORD*)&idx, x);
return idx;
}
#elif defined(__GNUC__) || defined(__clang__)