Skip to content

Commit

Permalink
Improve FMT_ALWAYS_INLINE (#1878)
Browse files Browse the repository at this point in the history
1. FMT_ALWAYS_INLINE should imply inline; otherwise, there might be
   linkage problems
2. Add specialization for MSVC (__forceinline)
  • Loading branch information
jk-jeon authored Sep 17, 2020
1 parent 7e68275 commit d55e61f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d55e61f

Please sign in to comment.