Skip to content

Commit a068912

Browse files
committed
Place two warning disables in their proper place.
Fixup comments Signed-off-by: Rosen Penev <rosenp@gmail.com>
1 parent 5ae5439 commit a068912

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

include/json/reader.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
#ifndef JSON_READER_H_INCLUDED
77
#define JSON_READER_H_INCLUDED
88

9+
#if defined(_MSC_VER)
10+
// Disable warning about deprecated destructors
11+
#pragma warning(disable : 4996)
12+
#endif
13+
914
#if !defined(JSON_IS_AMALGAMATION)
1015
#include "json_features.h"
1116
#include "value.h"

include/json/value.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@
4848

4949
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
5050
// be used by...
51+
// Disable warning C4275: non - DLL-interface class 'class_1' used as base for
52+
// DLL-interface class 'class_2'
5153
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
5254
#pragma warning(push)
5355
#pragma warning(disable : 4251)
56+
#pragma warning(disable : 4275)
5457
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
5558

5659
#pragma pack(push, 8)

include/json/writer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
#ifndef JSON_WRITER_H_INCLUDED
77
#define JSON_WRITER_H_INCLUDED
88

9+
#if defined(_MSC_VER)
10+
// Disable warning about deprecated destructors
11+
#pragma warning(disable : 4996)
12+
#endif
13+
914
#if !defined(JSON_IS_AMALGAMATION)
1015
#include "value.h"
1116
#endif // if !defined(JSON_IS_AMALGAMATION)
@@ -18,6 +23,7 @@
1823
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) && defined(_MSC_VER)
1924
#pragma warning(push)
2025
#pragma warning(disable : 4251)
26+
#pragma warning(disable : 4275)
2127
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
2228

2329
#pragma pack(push, 8)

src/lib_json/json_reader.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
#if !defined(_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
99
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
1010
#endif //_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
11-
12-
// Disable warning about strdup being deprecated.
13-
#pragma warning(disable : 4996)
1411
#endif //_MSC_VER
1512

1613
#if !defined(JSON_IS_AMALGAMATION)

src/lib_json/json_writer.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
#include <sstream>
2020
#include <utility>
2121

22-
#if defined(_MSC_VER)
23-
// Disable warning about strdup being deprecated.
24-
#pragma warning(disable : 4996)
25-
#endif
26-
2722
namespace Json {
2823

2924
using StreamWriterPtr = std::unique_ptr<StreamWriter>;

0 commit comments

Comments
 (0)