vkd3d: Always use _BitScanReverse on Windows.

Use ULONG instead of unsigned long for non-Mingw msvcrt builds.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
This commit is contained in:
Alexandre Julliard 2022-01-28 16:49:57 +01:00
parent 22e6581ffc
commit ab3aa96e1f

View File

@ -88,10 +88,10 @@ static inline bool vkd3d_bitmask_is_contiguous(unsigned int mask)
/* Undefined for x == 0. */ /* Undefined for x == 0. */
static inline unsigned int vkd3d_log2i(unsigned int x) static inline unsigned int vkd3d_log2i(unsigned int x)
{ {
#ifdef _MSC_VER #ifdef _WIN32
/* _BitScanReverse returns the index of the highest set bit, /* _BitScanReverse returns the index of the highest set bit,
* unlike clz which is 31 - index. */ * unlike clz which is 31 - index. */
unsigned long result; ULONG result;
_BitScanReverse(&result, x); _BitScanReverse(&result, x);
return (unsigned int)result; return (unsigned int)result;
#elif defined(HAVE_BUILTIN_CLZ) #elif defined(HAVE_BUILTIN_CLZ)