Skip to content

Commit 8b31c6f

Browse files
terrycz126hjmjohnson
authored andcommitted
Fix redefined(_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES) warning
1 parent a3c8e86 commit 8b31c6f

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/lib_json/json_reader.cpp

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

22-
#if __cplusplus >= 201103L
2322
#include <cstdio>
23+
#if __cplusplus >= 201103L
2424

2525
#if !defined(sscanf)
2626
#define sscanf std::sscanf
2727
#endif
28-
#else
29-
#include <cstdio>
28+
29+
#endif //__cplusplus
3030

3131
#if defined(_MSC_VER)
32+
#if !defined(_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
3233
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
33-
#endif
34-
#endif
34+
#endif //_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
35+
#endif //_MSC_VER
3536

3637
#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
3738
// Disable warning about strdup being deprecated.

src/lib_json/json_writer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@
4242
#define isfinite _finite
4343
#endif
4444

45+
#if !defined(_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
4546
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
46-
#endif
47+
#endif //_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
48+
49+
#endif //_MSC_VER
4750

4851
#if defined(__sun) && defined(__SVR4) // Solaris
4952
#if !defined(isfinite)

0 commit comments

Comments
 (0)