6
6
#ifndef JSON_CONFIG_H_INCLUDED
7
7
#define JSON_CONFIG_H_INCLUDED
8
8
#include < stddef.h>
9
- #include < string> // typedef String
10
9
#include < stdint.h> // typedef int64_t, uint64_t
10
+ #include < string> // typedef String
11
11
12
12
// / If defined, indicates that json library is embedded in CppTL library.
13
13
// # define JSON_IN_CPPTL 1
60
60
// #define JSON_NO_INT64 1
61
61
62
62
#if defined(_MSC_VER) // MSVC
63
- # if _MSC_VER <= 1200 // MSVC 6
64
- // Microsoft Visual Studio 6 only support conversion from __int64 to double
65
- // (no conversion from unsigned __int64).
66
- # define JSON_USE_INT64_DOUBLE_CONVERSION 1
67
- // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
68
- // characters in the debug information)
69
- // All projects I've ever seen with VS6 were using this globally (not bothering
70
- // with pragma push/pop).
71
- # pragma warning(disable : 4786)
72
- # endif // MSVC 6
73
-
74
- # if _MSC_VER >= 1500 // MSVC 2008
75
- // / Indicates that the following function is deprecated.
76
- # define JSONCPP_DEPRECATED (message ) __declspec(deprecated(message))
77
- # endif
63
+ #if _MSC_VER <= 1200 // MSVC 6
64
+ // Microsoft Visual Studio 6 only support conversion from __int64 to double
65
+ // (no conversion from unsigned __int64).
66
+ #define JSON_USE_INT64_DOUBLE_CONVERSION 1
67
+ // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
68
+ // characters in the debug information)
69
+ // All projects I've ever seen with VS6 were using this globally (not bothering
70
+ // with pragma push/pop).
71
+ #pragma warning(disable : 4786)
72
+ #endif // MSVC 6
73
+
74
+ #if _MSC_VER >= 1500 // MSVC 2008
75
+ // / Indicates that the following function is deprecated.
76
+ #define JSONCPP_DEPRECATED (message ) __declspec(deprecated(message))
77
+ #endif
78
78
79
79
#endif // defined(_MSC_VER)
80
80
81
81
// In c++11 the override keyword allows you to explicitly define that a function
82
82
// is intended to override the base-class version. This makes the code more
83
83
// manageable and fixes a set of common hard-to-find bugs.
84
84
#if __cplusplus >= 201103L
85
- # define JSONCPP_OVERRIDE override
86
- # define JSONCPP_NOEXCEPT noexcept
87
- # define JSONCPP_OP_EXPLICIT explicit
85
+ #define JSONCPP_OVERRIDE override
86
+ #define JSONCPP_NOEXCEPT noexcept
87
+ #define JSONCPP_OP_EXPLICIT explicit
88
88
#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
89
- # define JSONCPP_OVERRIDE override
90
- # define JSONCPP_NOEXCEPT throw ()
91
- # if _MSC_VER >= 1800 // MSVC 2013
92
- # define JSONCPP_OP_EXPLICIT explicit
93
- # else
94
- # define JSONCPP_OP_EXPLICIT
95
- # endif
89
+ #define JSONCPP_OVERRIDE override
90
+ #define JSONCPP_NOEXCEPT throw ()
91
+ #if _MSC_VER >= 1800 // MSVC 2013
92
+ #define JSONCPP_OP_EXPLICIT explicit
93
+ #else
94
+ #define JSONCPP_OP_EXPLICIT
95
+ #endif
96
96
#elif defined(_MSC_VER) && _MSC_VER >= 1900
97
- # define JSONCPP_OVERRIDE override
98
- # define JSONCPP_NOEXCEPT noexcept
99
- # define JSONCPP_OP_EXPLICIT explicit
97
+ #define JSONCPP_OVERRIDE override
98
+ #define JSONCPP_NOEXCEPT noexcept
99
+ #define JSONCPP_OP_EXPLICIT explicit
100
100
#else
101
- # define JSONCPP_OVERRIDE
102
- # define JSONCPP_NOEXCEPT throw ()
103
- # define JSONCPP_OP_EXPLICIT
101
+ #define JSONCPP_OVERRIDE
102
+ #define JSONCPP_NOEXCEPT throw ()
103
+ #define JSONCPP_OP_EXPLICIT
104
104
#endif
105
105
106
106
#ifndef JSON_HAS_RVALUE_REFERENCES
112
112
#ifdef __clang__
113
113
#if __has_feature(cxx_rvalue_references)
114
114
#define JSON_HAS_RVALUE_REFERENCES 1
115
- #endif // has_feature
115
+ #endif // has_feature
116
116
117
117
#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
118
118
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
119
119
#define JSON_HAS_RVALUE_REFERENCES 1
120
- #endif // GXX_EXPERIMENTAL
120
+ #endif // GXX_EXPERIMENTAL
121
121
122
122
#endif // __clang__ || __GNUC__
123
123
128
128
#endif
129
129
130
130
#ifdef __clang__
131
- # if __has_extension(attribute_deprecated_with_message)
132
- # define JSONCPP_DEPRECATED (message ) __attribute__ ((deprecated(message)))
133
- # endif
131
+ #if __has_extension(attribute_deprecated_with_message)
132
+ #define JSONCPP_DEPRECATED (message ) __attribute__((deprecated(message)))
133
+ #endif
134
134
#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
135
- # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
136
- # define JSONCPP_DEPRECATED (message ) __attribute__ ((deprecated(message)))
137
- # elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
138
- # define JSONCPP_DEPRECATED (message ) __attribute__((__deprecated__))
139
- # endif // GNUC version
135
+ #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
136
+ #define JSONCPP_DEPRECATED (message ) __attribute__((deprecated(message)))
137
+ #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
138
+ #define JSONCPP_DEPRECATED (message ) __attribute__((__deprecated__))
139
+ #endif // GNUC version
140
140
#endif // __clang__ || __GNUC__
141
141
142
142
#if !defined(JSONCPP_DEPRECATED)
143
143
#define JSONCPP_DEPRECATED (message )
144
144
#endif // if !defined(JSONCPP_DEPRECATED)
145
145
146
146
#if __GNUC__ >= 6
147
- # define JSON_USE_INT64_DOUBLE_CONVERSION 1
147
+ #define JSON_USE_INT64_DOUBLE_CONVERSION 1
148
148
#endif
149
149
150
150
#if !defined(JSON_IS_AMALGAMATION)
151
151
152
- # include " version.h"
152
+ #include " version.h"
153
153
154
- # if JSONCPP_USING_SECURE_MEMORY
155
- # include " allocator.h" // typedef Allocator
156
- # endif
154
+ #if JSONCPP_USING_SECURE_MEMORY
155
+ #include " allocator.h" // typedef Allocator
156
+ #endif
157
157
158
158
#endif // if !defined(JSON_IS_AMALGAMATION)
159
159
@@ -172,23 +172,28 @@ typedef unsigned __int64 UInt64;
172
172
#else // if defined(_MSC_VER) // Other platforms, use long long
173
173
typedef int64_t Int64;
174
174
typedef uint64_t UInt64 ;
175
- #endif // if defined(_MSC_VER)
175
+ #endif // if defined(_MSC_VER)
176
176
typedef Int64 LargestInt;
177
177
typedef UInt64 LargestUInt;
178
178
#define JSON_HAS_INT64
179
179
#endif // if defined(JSON_NO_INT64)
180
180
#if JSONCPP_USING_SECURE_MEMORY
181
- #define JSONCPP_STRING std::basic_string<char , std::char_traits<char >, Json::SecureAllocator<char > >
182
- #define JSONCPP_OSTRINGSTREAM std::basic_ostringstream<char , std::char_traits<char >, Json::SecureAllocator<char > >
183
- #define JSONCPP_OSTREAM std::basic_ostream<char , std::char_traits<char >>
184
- #define JSONCPP_ISTRINGSTREAM std::basic_istringstream<char , std::char_traits<char >, Json::SecureAllocator<char > >
185
- #define JSONCPP_ISTREAM std::istream
181
+ #define JSONCPP_STRING \
182
+ std::basic_string<char , std::char_traits<char >, Json::SecureAllocator<char > >
183
+ #define JSONCPP_OSTRINGSTREAM \
184
+ std::basic_ostringstream<char , std::char_traits<char >, \
185
+ Json::SecureAllocator<char > >
186
+ #define JSONCPP_OSTREAM std::basic_ostream<char , std::char_traits<char > >
187
+ #define JSONCPP_ISTRINGSTREAM \
188
+ std::basic_istringstream<char , std::char_traits<char >, \
189
+ Json::SecureAllocator<char > >
190
+ #define JSONCPP_ISTREAM std::istream
186
191
#else
187
- #define JSONCPP_STRING std::string
192
+ #define JSONCPP_STRING std::string
188
193
#define JSONCPP_OSTRINGSTREAM std::ostringstream
189
- #define JSONCPP_OSTREAM std::ostream
194
+ #define JSONCPP_OSTREAM std::ostream
190
195
#define JSONCPP_ISTRINGSTREAM std::istringstream
191
- #define JSONCPP_ISTREAM std::istream
196
+ #define JSONCPP_ISTREAM std::istream
192
197
#endif // if JSONCPP_USING_SECURE_MEMORY
193
198
} // end namespace Json
194
199
0 commit comments