From 2b24edd5b0e861a4675b08e1d894801ca78d3869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 19 Apr 2023 21:40:19 -0700 Subject: [PATCH] Fixed VS build. --- include/bx/inline/simd128_sse.inl | 2 +- tests/allocator_test.cpp | 6 +++--- tests/math_test.cpp | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/bx/inline/simd128_sse.inl b/include/bx/inline/simd128_sse.inl index fb7565b..4f21632 100644 --- a/include/bx/inline/simd128_sse.inl +++ b/include/bx/inline/simd128_sse.inl @@ -588,7 +588,7 @@ BX_SIMD128_IMPLEMENT_TEST(xyzw , 0xf) template<> BX_SIMD_INLINE simd128_sse_t simd_rsqrt_nr(simd128_sse_t _a) { - return simd_rsqrt_nr_ni(_a); + return simd_rsqrt_ni(_a); } template<> diff --git a/tests/allocator_test.cpp b/tests/allocator_test.cpp index cc93a59..1de97e0 100644 --- a/tests/allocator_test.cpp +++ b/tests/allocator_test.cpp @@ -24,19 +24,19 @@ struct MockNonFreeingAllocator : public bx::AllocatorI BX_ASSERT(m_sbrk + _size < BX_COUNTOF(m_storage), ""); BX_UNUSED(_ptr, _file, _line); - const uint32_t sbrk = bx::alignUp(m_sbrk, bx::max(_align, 1) ); + const uintptr_t sbrk = bx::alignUp(m_sbrk, bx::max(int32_t(_align), 1) ); m_sbrk = sbrk + _size; return &m_storage[sbrk]; } - uint32_t m_sbrk; + uintptr_t m_sbrk; BX_ALIGN_DECL(256, uint8_t) m_storage[0x10000]; }; bool testAlignment(size_t _expected, void* _ptr) { - bool aligned = bx::isAligned(_ptr, _expected); + bool aligned = bx::isAligned(_ptr, int32_t(_expected) ); // BX_TRACE("%p, %d", _ptr, _expected); BX_WARN(aligned, "%p not aligned to %d bytes.", _ptr, _expected); return aligned; diff --git a/tests/math_test.cpp b/tests/math_test.cpp index 702dbd1..c0926c6 100644 --- a/tests/math_test.cpp +++ b/tests/math_test.cpp @@ -22,6 +22,10 @@ TEST_CASE("isFinite, isInfinite, isNan", "") REQUIRE(::__isnanf(u.f) == bx::isNan(u.f) ); REQUIRE(::__isfinitef(u.f) == bx::isFinite(u.f) ); REQUIRE(::__isinff(u.f) == bx::isInfinite(u.f) ); +#elif BX_COMPILER_MSVC + REQUIRE(!!::_isnanf(u.f) == bx::isNan(u.f)); + REQUIRE(!!::_finitef(u.f) == bx::isFinite(u.f)); + REQUIRE(!!::isinf(u.f) == bx::isInfinite(u.f)); #else REQUIRE(::isnanf(u.f) == bx::isNan(u.f) ); REQUIRE(::finitef(u.f) == bx::isFinite(u.f) );