forked from fmtlib/fmt
Refactor Windows workarounds
This commit is contained in:
@ -34,13 +34,10 @@
|
|||||||
|
|
||||||
#ifdef __ICL
|
#ifdef __ICL
|
||||||
# define FMT_ICC_VERSION __ICL
|
# define FMT_ICC_VERSION __ICL
|
||||||
# define FMT_ICC_INTRINSIC_BUG 1
|
|
||||||
#elif defined(__INTEL_COMPILER)
|
#elif defined(__INTEL_COMPILER)
|
||||||
# define FMT_ICC_VERSION __INTEL_COMPILER
|
# define FMT_ICC_VERSION __INTEL_COMPILER
|
||||||
# define FMT_ICC_INTRINSIC_BUG 0
|
|
||||||
#else
|
#else
|
||||||
# define FMT_ICC_VERSION 0
|
# define FMT_ICC_VERSION 0
|
||||||
# define FMT_ICC_INTRINSIC_BUG 0
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __NVCC__
|
#ifdef __NVCC__
|
||||||
|
@ -155,24 +155,25 @@ FMT_END_NAMESPACE
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// __builtin_clz is broken in clang with Microsoft CodeGen:
|
// __builtin_clz is broken in clang with Microsoft CodeGen:
|
||||||
// https://github.com/fmtlib/fmt/issues/519
|
// https://github.com/fmtlib/fmt/issues/519.
|
||||||
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz) || FMT_ICC_VERSION) && \
|
#ifndef FMT_MSC_VER
|
||||||
!FMT_MSC_VER
|
# if FMT_HAS_BUILTIN(__builtin_clz) || FMT_GCC_VERSION || FMT_ICC_VERSION
|
||||||
# define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
|
# define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
|
||||||
|
# endif
|
||||||
|
# if FMT_HAS_BUILTIN(__builtin_clzll) || FMT_GCC_VERSION || FMT_ICC_VERSION
|
||||||
|
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll) || \
|
|
||||||
FMT_ICC_VERSION) && \
|
// __builtin_ctz is broken in Intel Compiler Classic on Windows:
|
||||||
!FMT_MSC_VER
|
// https://github.com/fmtlib/fmt/issues/2510.
|
||||||
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
#ifndef __ICL
|
||||||
#endif
|
# if FMT_HAS_BUILTIN(__builtin_ctz) || FMT_GCC_VERSION || FMT_ICC_VERSION
|
||||||
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctz) || FMT_ICC_VERSION) && \
|
# define FMT_BUILTIN_CTZ(n) __builtin_ctz(n)
|
||||||
!FMT_ICC_INTRINSIC_BUG
|
# endif
|
||||||
# define FMT_BUILTIN_CTZ(n) __builtin_ctz(n)
|
# if FMT_HAS_BUILTIN(__builtin_ctzll) || FMT_GCC_VERSION || FMT_ICC_VERSION
|
||||||
#endif
|
# define FMT_BUILTIN_CTZLL(n) __builtin_ctzll(n)
|
||||||
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctzll) || \
|
# endif
|
||||||
FMT_ICC_VERSION) && \
|
|
||||||
!FMT_ICC_INTRINSIC_BUG
|
|
||||||
# define FMT_BUILTIN_CTZLL(n) __builtin_ctzll(n)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FMT_MSC_VER
|
#if FMT_MSC_VER
|
||||||
|
Reference in New Issue
Block a user