mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-04 17:26:42 +00:00
Workaround broken __builtin_clz in clang with MS codegen (#519)
This commit is contained in:
parent
eafc6a3292
commit
569c5bdbf1
14
fmt/format.h
14
fmt/format.h
@ -287,12 +287,16 @@ typedef __int64 intmax_t;
|
|||||||
# define FMT_ASSERT(condition, message) assert((condition) && message)
|
# define FMT_ASSERT(condition, message) assert((condition) && message)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clz)
|
// __builtin_clz is broken in clang with Microsoft CodeGen:
|
||||||
# define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
|
// https://github.com/fmtlib/fmt/issues/519
|
||||||
#endif
|
#ifndef _MSC_VER
|
||||||
|
# if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clz)
|
||||||
|
# define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
|
||||||
|
# endif
|
||||||
|
|
||||||
#if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clzll)
|
# if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clzll)
|
||||||
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Some compilers masquerade as both MSVC and GCC-likes or
|
// Some compilers masquerade as both MSVC and GCC-likes or
|
||||||
|
Loading…
Reference in New Issue
Block a user