mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-01-26 18:56:59 +00:00
common/bitops: mingw32: reorder so __GNUC__ define is checked first
This commit is contained in:
parent
a299c362dd
commit
314a849ae2
28
bitops.h
28
bitops.h
@ -27,7 +27,20 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && !defined(_WIN64)
|
||||
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
static inline int spice_bit_find_msb(unsigned int val)
|
||||
{
|
||||
int ret;
|
||||
|
||||
asm ("bsrl %1,%0\n\t"
|
||||
"jnz 1f\n\t"
|
||||
"movl $-1,%0\n"
|
||||
"1:"
|
||||
: "=r"(ret) : "r"(val));
|
||||
return ret + 1;
|
||||
}
|
||||
|
||||
#elif defined(WIN32) && !defined(_WIN64)
|
||||
static INLINE int spice_bit_find_msb(uint32_t val)
|
||||
{
|
||||
uint32_t r;
|
||||
@ -42,19 +55,6 @@ found:
|
||||
return r + 1;
|
||||
}
|
||||
|
||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
static inline int spice_bit_find_msb(unsigned int val)
|
||||
{
|
||||
int ret;
|
||||
|
||||
asm ("bsrl %1,%0\n\t"
|
||||
"jnz 1f\n\t"
|
||||
"movl $-1,%0\n"
|
||||
"1:"
|
||||
: "=r"(ret) : "r"(val));
|
||||
return ret + 1;
|
||||
}
|
||||
|
||||
#else
|
||||
static INLINE int spice_bit_find_msb(unsigned int val)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user