diff options
author | Alon Levy <alevy@redhat.com> | 2012-01-13 12:57:35 +0200 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-01-13 17:42:23 +0200 |
commit | 7a63185b9bf063fe23a470be4ecac6082cbb1a91 (patch) | |
tree | ac0968a87843e9d440b388826769076e9d9bdb29 /common | |
parent | c7f4e52000bfdd7a0f502abecd5da444c3709c38 (diff) | |
download | spice-7a63185b9bf063fe23a470be4ecac6082cbb1a91.tar.gz spice-7a63185b9bf063fe23a470be4ecac6082cbb1a91.tar.xz spice-7a63185b9bf063fe23a470be4ecac6082cbb1a91.zip |
common/bitops: mingw32: reorder so __GNUC__ define is checked first
Diffstat (limited to 'common')
-rw-r--r-- | common/bitops.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/common/bitops.h b/common/bitops.h index 449409bd..bdd862a3 100644 --- a/common/bitops.h +++ b/common/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) { |