Go to the documentation of this file.
6 #ifndef JSON_CONFIG_H_INCLUDED
7 #define JSON_CONFIG_H_INCLUDED
15 #include <type_traits>
19 #ifndef JSON_USE_EXCEPTION
20 #define JSON_USE_EXCEPTION 1
24 #ifndef JSON_USE_NULLREF
25 #define JSON_USE_NULLREF 1
34 #if defined(JSON_DLL_BUILD)
35 #if defined(_MSC_VER) || defined(__MINGW32__)
36 #define JSON_API __declspec(dllexport)
37 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
38 #elif defined(__OS2__)
39 #define JSON_API __declspec(dllexport)
40 #elif defined(__GNUC__) || defined(__clang__)
41 #define JSON_API __attribute__((visibility("default")))
42 #endif // if defined(_MSC_VER)
44 #elif defined(JSON_DLL)
45 #if defined(_MSC_VER) || defined(__MINGW32__)
46 #define JSON_API __declspec(dllimport)
47 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
48 #endif // if defined(_MSC_VER)
49 #endif // ifdef JSON_DLL_BUILD
51 #if !defined(JSON_API)
55 #if defined(_MSC_VER) && _MSC_VER < 1800
57 "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
60 #if defined(_MSC_VER) && _MSC_VER < 1900
64 const char* format, ...);
65 #define jsoncpp_snprintf msvc_pre1900_c99_snprintf
67 #define jsoncpp_snprintf std::snprintf
77 #define JSONCPP_OVERRIDE override
80 #if __has_extension(attribute_deprecated_with_message)
81 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
83 #elif defined(__GNUC__) // not clang (gcc comes later since clang emulates gcc)
84 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
85 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
86 #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
87 #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
88 #endif // GNUC version
89 #elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates
91 #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
92 #endif // __clang__ || __GNUC__ || _MSC_VER
94 #if !defined(JSONCPP_DEPRECATED)
95 #define JSONCPP_DEPRECATED(message)
96 #endif // if !defined(JSONCPP_DEPRECATED)
98 #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6))
99 #define JSON_USE_INT64_DOUBLE_CONVERSION 1
102 #if !defined(JSON_IS_AMALGAMATION)
107 #endif // if !defined(JSON_IS_AMALGAMATION)
112 #if defined(JSON_NO_INT64)
115 #undef JSON_HAS_INT64
116 #else // if defined(JSON_NO_INT64)
118 #if defined(_MSC_VER) // Microsoft Visual Studio
121 #else // if defined(_MSC_VER) // Other platforms, use long long
122 using Int64 = int64_t;
124 #endif // if defined(_MSC_VER)
127 #define JSON_HAS_INT64
128 #endif // if defined(JSON_NO_INT64)
130 template <
typename T>
132 typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator<T>,
133 std::allocator<T>>::type;
136 std::basic_istringstream<String::value_type, String::traits_type,
137 String::allocator_type>;
139 std::basic_ostringstream<String::value_type, String::traits_type,
140 String::allocator_type>;
152 #endif // JSON_CONFIG_H_INCLUDED
std::basic_ostringstream< String::value_type, String::traits_type, String::allocator_type > OStringStream
Json::IStringStream JSONCPP_ISTRINGSTREAM
typename std::conditional< 0, SecureAllocator< T >, std::allocator< T > >::type Allocator
int msvc_pre1900_c99_snprintf(char *outBuf, size_t size, const char *format,...)
Json::OStream JSONCPP_OSTREAM
std::basic_istringstream< String::value_type, String::traits_type, String::allocator_type > IStringStream
Json::IStream JSONCPP_ISTREAM
JSON (JavaScript Object Notation).
#define JSON_API
If defined, indicates that the source file is amalgamated to prevent private header inclusion.
Json::OStringStream JSONCPP_OSTRINGSTREAM
std::basic_string< char, std::char_traits< char >, Allocator< char > > String
Json::String JSONCPP_STRING