From 132840aaa14421f1424fb174ebf8fd2d5991fe1f Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Mon, 11 Sep 2017 13:39:38 -0500 Subject: [PATCH] More VS warning prevention See comment by jpo38 in SO: * https://stackoverflow.com/questions/46151531/how-works-deprecated-warnings-and-how-to-remove-them-when-using-jsoncpp/46156833#46156833 --- include/json/writer.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/json/writer.h b/include/json/writer.h index 87365ef..ca57970 100644 --- a/include/json/writer.h +++ b/include/json/writer.h @@ -159,7 +159,6 @@ public: #pragma warning(push) #pragma warning(disable:4996) // Deriving from deprecated class class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API FastWriter : public Writer { -#pragma warning(pop) public: FastWriter(); ~FastWriter() JSONCPP_OVERRIDE {} @@ -186,6 +185,7 @@ private: bool dropNullPlaceholders_; bool omitEndingLineFeed_; }; +#pragma warning(pop) /** \brief Writes a Value in JSON format in a *human friendly way. @@ -214,7 +214,6 @@ private: #pragma warning(push) #pragma warning(disable:4996) // Deriving from deprecated class class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API StyledWriter : public Writer { -#pragma warning(pop) public: StyledWriter(); ~StyledWriter() JSONCPP_OVERRIDE {} @@ -249,6 +248,7 @@ private: unsigned int indentSize_; bool addChildValues_; }; +#pragma warning(pop) /** \brief Writes a Value in JSON format in a human friendly way, @@ -275,6 +275,8 @@ private: * \sa Reader, Value, Value::setComment() * \deprecated Use StreamWriterBuilder. */ +#pragma warning(push) +#pragma warning(disable:4996) // Deriving from deprecated class class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API StyledStreamWriter { public: /** @@ -316,6 +318,7 @@ private: bool addChildValues_ : 1; bool indented_ : 1; }; +#pragma warning(pop) #if defined(JSON_HAS_INT64) JSONCPP_STRING JSON_API valueToString(Int value);