aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alMain.h
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r--OpenAL32/Include/alMain.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index f3ffac29..afa3eee3 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -97,13 +97,13 @@ typedef ALuint64SOFT ALuint64;
#define CTZ64(x) __builtin_ctzll(x)
#endif
-#elif defined(_MSC_VER)
+#elif defined(HAVE_BITSCANFORWARD64_INTRINSIC)
static inline int msvc_ctz64(ALuint64 v)
{
- unsigned long idx = 0;
+ unsigned long idx = 64;
_BitScanForward64(&idx, v);
- return idx;
+ return (int)idx;
}
#define CTZ64(x) msvc_ctz64(x)
@@ -121,7 +121,7 @@ static inline int fallback_popcnt64(ALuint64 v)
v = v - ((v >> 1) & U64(0x5555555555555555));
v = (v & U64(0x3333333333333333)) + ((v >> 2) & U64(0x3333333333333333));
v = (v + (v >> 4)) & U64(0x0f0f0f0f0f0f0f0f);
- return (v * U64(0x0101010101010101)) >> 56;
+ return (int)((v * U64(0x0101010101010101)) >> 56);
}
static inline int fallback_ctz64(ALuint64 value)