Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabime <gmelman1@gmail.comx>2022-10-31 18:47:12 +0300
committergabime <gmelman1@gmail.comx>2022-10-31 18:47:12 +0300
commit14a29c03eb15783e798c1978f2613c0d6732cbe0 (patch)
treea9501c131a934640e8f4f45056eb3758a8335fee
parenta7e2bf161e2f038cce2d32131452e8806ed437e1 (diff)
suppress warning 4307 when including format-inline.h under msvc 2017
-rw-r--r--include/spdlog/fmt/fmt.h11
-rw-r--r--src/bundled_fmtlib_format.cpp4
2 files changed, 13 insertions, 2 deletions
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 <spdlog/fmt/bundled/core.h>
# include <spdlog/fmt/bundled/format.h>
#else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib
# include <fmt/core.h>
# include <fmt/format.h>
#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 <spdlog/fmt/bundled/format-inl.h>
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && ((_MSC_VER >= 1910) && (_MSC_VER <= 1916))
# pragma warning(pop)
#endif