diff --git a/include/spdlog/fmt/fmt.h b/include/spdlog/fmt/fmt.h index fa4a2a84..d57ed002 100644 --- a/include/spdlog/fmt/fmt.h +++ b/include/spdlog/fmt/fmt.h @@ -21,9 +21,20 @@ # endif // enable the 'n' flag in for backward compatibility with fmt 6.x # define FMT_DEPRECATED_N_SPECIFIER + +// suppress "integral constant overflow" warning under msvc 2017 (which doesn't appear in other msvc versions) +#if defined(_MSC_VER) && ((_MSC_VER >= 1910) && (_MSC_VER <= 1916)) +# pragma warning(push) +# pragma warning(disable : 4307) +#endif + # include # include #else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib # include # include #endif + +#if defined(_MSC_VER) && ((_MSC_VER >= 1910) && (_MSC_VER <= 1916)) +# pragma warning(pop) +#endif diff --git a/src/bundled_fmtlib_format.cpp b/src/bundled_fmtlib_format.cpp index ada16cd7..772a6717 100644 --- a/src/bundled_fmtlib_format.cpp +++ b/src/bundled_fmtlib_format.cpp @@ -9,13 +9,13 @@ #if !defined(SPDLOG_FMT_EXTERNAL) && !defined(SPDLOG_USE_STD_FORMAT) // suppress "integral constant overflow" warning under msvc 2017 (which doesn't appear in other msvc versions) -#if defined(_MSC_VER) && (_MSC_VER >= 1910) && (_MSC_VER <= 1916) +#if defined(_MSC_VER) && ((_MSC_VER >= 1910) && (_MSC_VER <= 1916)) # pragma warning(push) # pragma warning(disable : 4307) #endif # include -#if defined(_MSC_VER) +#if defined(_MSC_VER) && ((_MSC_VER >= 1910) && (_MSC_VER <= 1916)) # pragma warning(pop) #endif