From 5745f2f75d68c8d3832748fa14229ae560a3d58d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 30 Jan 2019 13:21:19 -0500 Subject: [PATCH] qemu/host_utils: Handle MSVC within clrsb32/64 --- qemu/include/qemu/host-utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/include/qemu/host-utils.h b/qemu/include/qemu/host-utils.h index ed1d2689..ff80be17 100644 --- a/qemu/include/qemu/host-utils.h +++ b/qemu/include/qemu/host-utils.h @@ -263,7 +263,7 @@ static inline int cto64(uint64_t val) */ static inline int clrsb32(uint32_t val) { -#if __has_builtin(__builtin_clrsb) || !defined(__clang__) +#if __has_builtin(__builtin_clrsb) || (!defined(__clang__) && !defined(_MSC_VER)) return __builtin_clrsb(val); #else return clz32(val ^ ((int32_t)val >> 1)) - 1; @@ -279,7 +279,7 @@ static inline int clrsb32(uint32_t val) */ static inline int clrsb64(uint64_t val) { -#if __has_builtin(__builtin_clrsbll) || !defined(__clang__) +#if __has_builtin(__builtin_clrsbll) || (!defined(__clang__) && !defined(_MSC_VER)) return __builtin_clrsbll(val); #else return clz64(val ^ ((int64_t)val >> 1)) - 1;