Skip to content

Commit 31d6571

Browse files
committed
ENH: Remove conditionals for unsupported VS compilers
Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities See: https://blogs.msdn.microsoft.com/vcblog/2013/12/02/c1114-core-language-features-in-vs-2013-and-the-nov-2013-ctp/ for details related to language features supported.
1 parent 2853b1c commit 31d6571

File tree

6 files changed

+12
-27
lines changed

6 files changed

+12
-27
lines changed

doc/doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ INCLUDE_FILE_PATTERNS = *.h
19441944
# recursively expanded use the := operator instead of the = operator.
19451945
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
19461946

1947-
PREDEFINED = "_MSC_VER=1400" \
1947+
PREDEFINED = "_MSC_VER=1800" \
19481948
_CPPRTTI \
19491949
_WIN32 \
19501950
JSONCPP_DOC_EXCLUDE_IMPLEMENTATION

doc/web_doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,7 @@ INCLUDE_FILE_PATTERNS = *.h
19321932
# recursively expanded use the := operator instead of the = operator.
19331933
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
19341934

1935-
PREDEFINED = "_MSC_VER=1400" \
1935+
PREDEFINED = "_MSC_VER=1800" \
19361936
_CPPRTTI \
19371937
_WIN32 \
19381938
JSONCPP_DOC_EXCLUDE_IMPLEMENTATION

include/json/config.h

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
#define JSON_API
5555
#endif
5656

57+
#if defined(_MSC_VER) && _MSC_VER < 1800
58+
#error "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
59+
#endif
60+
5761
#if defined(_MSC_VER) && _MSC_VER < 1900
5862
// As recommended at https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
5963
extern JSON_API int msvc_pre1900_c99_snprintf(char *outBuf, size_t size, const char *format, ...);
@@ -68,22 +72,7 @@
6872
// #define JSON_NO_INT64 1
6973

7074
#if defined(_MSC_VER) // MSVC
71-
#if _MSC_VER <= 1200 // MSVC 6
72-
// Microsoft Visual Studio 6 only support conversion from __int64 to double
73-
// (no conversion from unsigned __int64).
74-
#define JSON_USE_INT64_DOUBLE_CONVERSION 1
75-
// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
76-
// characters in the debug information)
77-
// All projects I've ever seen with VS6 were using this globally (not bothering
78-
// with pragma push/pop).
79-
#pragma warning(disable : 4786)
80-
#endif // MSVC 6
81-
82-
#if _MSC_VER >= 1500 // MSVC 2008
83-
/// Indicates that the following function is deprecated.
8475
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
85-
#endif
86-
8776
#endif // defined(_MSC_VER)
8877

8978
// In c++11 the override keyword allows you to explicitly define that a function
@@ -93,13 +82,9 @@
9382
#if __cplusplus >= 201103L
9483
#define JSONCPP_NOEXCEPT noexcept
9584
#define JSONCPP_OP_EXPLICIT explicit
96-
#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
85+
#elif defined(_MSC_VER) && _MSC_VER < 1900
9786
#define JSONCPP_NOEXCEPT throw()
98-
#if _MSC_VER >= 1800 // MSVC 2013
9987
#define JSONCPP_OP_EXPLICIT explicit
100-
#else
101-
#define JSONCPP_OP_EXPLICIT
102-
#endif
10388
#elif defined(_MSC_VER) && _MSC_VER >= 1900
10489
#define JSONCPP_NOEXCEPT noexcept
10590
#define JSONCPP_OP_EXPLICIT explicit
@@ -110,9 +95,9 @@
11095

11196
#ifndef JSON_HAS_RVALUE_REFERENCES
11297

113-
#if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
98+
#if defined(_MSC_VER)
11499
#define JSON_HAS_RVALUE_REFERENCES 1
115-
#endif // MSVC >= 2010
100+
#endif // MSVC >= 2013
116101

117102
#ifdef __clang__
118103
#if __has_feature(cxx_rvalue_references)

src/lib_json/json_reader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#endif //_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
3535
#endif //_MSC_VER
3636

37-
#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
37+
#if defined(_MSC_VER)
3838
// Disable warning about strdup being deprecated.
3939
#pragma warning(disable : 4996)
4040
#endif

src/lib_json/json_value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int JSON_API msvc_pre1900_c99_snprintf(char *outBuf, size_t size, const char *fo
4343
#endif
4444

4545
// Disable warning C4702 : unreachable code
46-
#if defined(_MSC_VER) && _MSC_VER >= 1800 // VC++ 12.0 and above
46+
#if defined(_MSC_VER)
4747
#pragma warning(disable : 4702)
4848
#endif
4949

src/lib_json/json_writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#endif
7777
#endif
7878

79-
#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
79+
#if defined(_MSC_VER)
8080
// Disable warning about strdup being deprecated.
8181
#pragma warning(disable : 4996)
8282
#endif

0 commit comments

Comments
 (0)