Improve FMT_ALWAYS_INLINE (#1878)

1. FMT_ALWAYS_INLINE should imply inline; otherwise, there might be
   linkage problems
2. Add specialization for MSVC (__forceinline)
This commit is contained in:
jk-jeon 2020-09-17 15:21:17 -07:00 committed by GitHub
parent 7e6827521a
commit d55e61f120
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -870,8 +870,10 @@ template <> int count_digits<4>(detail::fallback_uintptr n);
#if FMT_GCC_VERSION || FMT_CLANG_VERSION #if FMT_GCC_VERSION || FMT_CLANG_VERSION
# define FMT_ALWAYS_INLINE inline __attribute__((always_inline)) # define FMT_ALWAYS_INLINE inline __attribute__((always_inline))
#elif FMT_MSC_VER
# define FMT_ALWAYS_INLINE __forceinline
#else #else
# define FMT_ALWAYS_INLINE # define FMT_ALWAYS_INLINE inline
#endif #endif
#ifdef FMT_BUILTIN_CLZ #ifdef FMT_BUILTIN_CLZ