From 74fb1effd1ea7cf2b5ef93322b6bf0816dc42489 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 29 Oct 2020 13:33:28 -0700 Subject: [PATCH] Squelch class dllexport warning --- include/boost/json/detail/default_resource.hpp | 9 +++++++++ include/boost/json/detail/shared_resource.hpp | 9 +++++++++ include/boost/json/monotonic_resource.hpp | 10 ++++++++++ include/boost/json/static_resource.hpp | 9 +++++++++ 4 files changed, 37 insertions(+) diff --git a/include/boost/json/detail/default_resource.hpp b/include/boost/json/detail/default_resource.hpp index 2a592023..3dc602cc 100644 --- a/include/boost/json/detail/default_resource.hpp +++ b/include/boost/json/detail/default_resource.hpp @@ -16,6 +16,12 @@ BOOST_JSON_NS_BEGIN namespace detail { +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4251) // class needs to have dll-interface to be used by clients of class +#pragma warning(disable: 4275) // non dll-interface class used as base for dll-interface class +#endif + // A simple memory resource that uses operator new and delete. class BOOST_SYMBOL_VISIBLE @@ -65,6 +71,9 @@ public: memory_resource const& mr) const noexcept override; }; +#ifdef _MSC_VER +#pragma warning(pop) +#endif union default_resource:: holder diff --git a/include/boost/json/detail/shared_resource.hpp b/include/boost/json/detail/shared_resource.hpp index 0bfe2e84..95595aae 100644 --- a/include/boost/json/detail/shared_resource.hpp +++ b/include/boost/json/detail/shared_resource.hpp @@ -17,6 +17,11 @@ BOOST_JSON_NS_BEGIN namespace detail { +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4275) // non dll-interface class used as base for dll-interface class +#endif + struct BOOST_SYMBOL_VISIBLE shared_resource : memory_resource @@ -70,6 +75,10 @@ public: } }; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + } // detail BOOST_JSON_NS_END diff --git a/include/boost/json/monotonic_resource.hpp b/include/boost/json/monotonic_resource.hpp index 5bdcfd55..8ecb0173 100644 --- a/include/boost/json/monotonic_resource.hpp +++ b/include/boost/json/monotonic_resource.hpp @@ -19,6 +19,12 @@ BOOST_JSON_NS_BEGIN +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4251) // class needs to have dll-interface to be used by clients of class +#pragma warning(disable: 4275) // non dll-interface class used as base for dll-interface class +#endif + //---------------------------------------------------------- /** A dynamically allocating resource with a trivial deallocate @@ -328,6 +334,10 @@ protected: #endif }; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + template<> struct is_deallocate_trivial< monotonic_resource> diff --git a/include/boost/json/static_resource.hpp b/include/boost/json/static_resource.hpp index 469edcb1..7ea799d8 100644 --- a/include/boost/json/static_resource.hpp +++ b/include/boost/json/static_resource.hpp @@ -16,6 +16,11 @@ BOOST_JSON_NS_BEGIN +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4275) // non dll-interface class used as base for dll-interface class +#endif + //---------------------------------------------------------- /** A resource using a caller-owned buffer, with a trivial deallocate @@ -222,6 +227,10 @@ protected: #endif }; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + template<> struct is_deallocate_trivial< static_resource>