From d55e61f1203e9c75d62467434383e66af0c486ab Mon Sep 17 00:00:00 2001 From: jk-jeon <33922675+jk-jeon@users.noreply.github.com> Date: Thu, 17 Sep 2020 15:21:17 -0700 Subject: [PATCH] Improve FMT_ALWAYS_INLINE (#1878) 1. FMT_ALWAYS_INLINE should imply inline; otherwise, there might be linkage problems 2. Add specialization for MSVC (__forceinline) --- include/fmt/format.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 98c15c64..2fd6ee1f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -870,8 +870,10 @@ template <> int count_digits<4>(detail::fallback_uintptr n); #if FMT_GCC_VERSION || FMT_CLANG_VERSION # define FMT_ALWAYS_INLINE inline __attribute__((always_inline)) +#elif FMT_MSC_VER +# define FMT_ALWAYS_INLINE __forceinline #else -# define FMT_ALWAYS_INLINE +# define FMT_ALWAYS_INLINE inline #endif #ifdef FMT_BUILTIN_CLZ