tuklib_integer: Cleanup MSVC-specific code.
This commit is contained in:
parent
33773c6f2a
commit
264ab971ce
|
@ -546,11 +546,9 @@ bsr32(uint32_t n)
|
||||||
__asm__("bsrl %1, %0" : "=r" (i) : "rm" (n));
|
__asm__("bsrl %1, %0" : "=r" (i) : "rm" (n));
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
#elif defined(_MSC_VER)
|
||||||
// MSVC isn't supported by tuklib, but since this code exists,
|
unsigned long i;
|
||||||
// it doesn't hurt to have it here anyway.
|
_BitScanReverse(&i, n);
|
||||||
uint32_t i;
|
|
||||||
_BitScanReverse((DWORD *)&i, n);
|
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -600,9 +598,9 @@ clz32(uint32_t n)
|
||||||
: "=r" (i) : "rm" (n));
|
: "=r" (i) : "rm" (n));
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
#elif defined(_MSC_VER)
|
||||||
uint32_t i;
|
unsigned long i;
|
||||||
_BitScanReverse((DWORD *)&i, n);
|
_BitScanReverse(&i, n);
|
||||||
return i ^ 31U;
|
return i ^ 31U;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -650,9 +648,9 @@ ctz32(uint32_t n)
|
||||||
__asm__("bsfl %1, %0" : "=r" (i) : "rm" (n));
|
__asm__("bsfl %1, %0" : "=r" (i) : "rm" (n));
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
#elif defined(_MSC_VER)
|
||||||
uint32_t i;
|
unsigned long i;
|
||||||
_BitScanForward((DWORD *)&i, n);
|
_BitScanForward(&i, n);
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue