From 05a6cfeaeaca3365f455445a9b986673752309ab Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Wed, 10 Feb 2021 18:04:16 +0100 Subject: [PATCH] Some more reduction of compiler warnings on MSVC --- src/libslic3r/GCodeSender.hpp | 2 +- src/libslic3r/Geometry.hpp | 2 +- src/libslic3r/OpenVDBUtils.cpp | 10 ++++++++++ src/libslic3r/OpenVDBUtils.hpp | 9 +++++++++ src/libslic3r/pchheader.hpp | 9 ++++++++- src/slic3r/GUI/NotificationManager.cpp | 2 +- src/slic3r/pchheader.hpp | 7 +++++++ 7 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/GCodeSender.hpp b/src/libslic3r/GCodeSender.hpp index d7663ca55..3a2055e54 100644 --- a/src/libslic3r/GCodeSender.hpp +++ b/src/libslic3r/GCodeSender.hpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include namespace Slic3r { diff --git a/src/libslic3r/Geometry.hpp b/src/libslic3r/Geometry.hpp index 8b062276e..9d98ea6ae 100644 --- a/src/libslic3r/Geometry.hpp +++ b/src/libslic3r/Geometry.hpp @@ -13,7 +13,7 @@ #define BOOST_VORONOI_USE_GMP 1 #ifdef _MSC_VER -// Suppress warning C4146 in include/gmp.h(2177,31): unary minus operator applied to unsigned type, result still unsigned +// Suppress warning C4146 in OpenVDB: unary minus operator applied to unsigned type, result still unsigned #pragma warning(push) #pragma warning(disable : 4146) #endif // _MSC_VER diff --git a/src/libslic3r/OpenVDBUtils.cpp b/src/libslic3r/OpenVDBUtils.cpp index 31ae203dd..0f5bfa157 100644 --- a/src/libslic3r/OpenVDBUtils.cpp +++ b/src/libslic3r/OpenVDBUtils.cpp @@ -1,6 +1,16 @@ #define NOMINMAX #include "OpenVDBUtils.hpp" + +#ifdef _MSC_VER +// Suppress warning C4146 in OpenVDB: unary minus operator applied to unsigned type, result still unsigned +#pragma warning(push) +#pragma warning(disable : 4146) +#endif // _MSC_VER #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif // _MSC_VER + #include #include #include diff --git a/src/libslic3r/OpenVDBUtils.hpp b/src/libslic3r/OpenVDBUtils.hpp index e35231d35..aa4b5154a 100644 --- a/src/libslic3r/OpenVDBUtils.hpp +++ b/src/libslic3r/OpenVDBUtils.hpp @@ -3,7 +3,16 @@ #include #include + +#ifdef _MSC_VER +// Suppress warning C4146 in include/gmp.h(2177,31): unary minus operator applied to unsigned type, result still unsigned +#pragma warning(push) +#pragma warning(disable : 4146) +#endif // _MSC_VER #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif // _MSC_VER namespace Slic3r { diff --git a/src/libslic3r/pchheader.hpp b/src/libslic3r/pchheader.hpp index a1d6da5fe..9386fdf36 100644 --- a/src/libslic3r/pchheader.hpp +++ b/src/libslic3r/pchheader.hpp @@ -60,7 +60,7 @@ #include #include #include -#include +#include #include #include #include @@ -88,8 +88,15 @@ #include #include #include + +// boost/property_tree/json_parser/detail/parser.hpp includes boost/bind.hpp, which is deprecated. +// Suppress the following boost message: +// The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. +#define BOOST_BIND_GLOBAL_PLACEHOLDERS #include #include +#undef BOOST_BIND_GLOBAL_PLACEHOLDERS + #include #include diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 78969d725..b7bc50d24 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/src/slic3r/pchheader.hpp b/src/slic3r/pchheader.hpp index ebdabe836..816733f45 100644 --- a/src/slic3r/pchheader.hpp +++ b/src/slic3r/pchheader.hpp @@ -78,10 +78,17 @@ #include #include #include + +// boost/property_tree/json_parser/detail/parser.hpp includes boost/bind.hpp, which is deprecated. +// Suppress the following boost message: +// The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. +#define BOOST_BIND_GLOBAL_PLACEHOLDERS #include #include #include #include +#undef BOOST_BIND_GLOBAL_PLACEHOLDERS + #include #include