|
4 | 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
5 | 5 |
|
6 | 6 | #ifndef JSON_CONFIG_H_INCLUDED
|
7 |
| -# define JSON_CONFIG_H_INCLUDED |
| 7 | +#define JSON_CONFIG_H_INCLUDED |
8 | 8 |
|
9 | 9 | /// If defined, indicates that json library is embedded in CppTL library.
|
10 | 10 | //# define JSON_IN_CPPTL 1
|
11 | 11 |
|
12 | 12 | /// If defined, indicates that json may leverage CppTL library
|
13 | 13 | //# define JSON_USE_CPPTL 1
|
14 |
| -/// If defined, indicates that cpptl vector based map should be used instead of std::map |
| 14 | +/// If defined, indicates that cpptl vector based map should be used instead of |
| 15 | +/// std::map |
15 | 16 | /// as Value container.
|
16 | 17 | //# define JSON_USE_CPPTL_SMALLMAP 1
|
17 | 18 | /// If defined, indicates that Json specific container should be used
|
18 | 19 | /// (hash table & simple deque container with customizable allocator).
|
19 | 20 | /// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332
|
20 | 21 | //# define JSON_VALUE_USE_INTERNAL_MAP 1
|
21 |
| -/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. |
22 |
| -/// The memory pools allocator used optimization (initializing Value and ValueInternalLink |
| 22 | +/// Force usage of standard new/malloc based allocator instead of memory pool |
| 23 | +/// based allocator. |
| 24 | +/// The memory pools allocator used optimization (initializing Value and |
| 25 | +/// ValueInternalLink |
23 | 26 | /// as if it was a POD) that may cause some validation tool to report errors.
|
24 | 27 | /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.
|
25 | 28 | //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1
|
26 | 29 |
|
27 | 30 | // If non-zero, the library uses exceptions to report bad input instead of C
|
28 | 31 | // assertion macros. The default is to use exceptions.
|
29 |
| -# ifndef JSON_USE_EXCEPTION |
30 |
| -# define JSON_USE_EXCEPTION 1 |
31 |
| -# endif |
| 32 | +#ifndef JSON_USE_EXCEPTION |
| 33 | +#define JSON_USE_EXCEPTION 1 |
| 34 | +#endif |
32 | 35 |
|
33 | 36 | /// If defined, indicates that the source file is amalgated
|
34 | 37 | /// to prevent private header inclusion.
|
35 | 38 | /// Remarks: it is automatically defined in the generated amalgated header.
|
36 | 39 | // #define JSON_IS_AMALGAMATION
|
37 | 40 |
|
| 41 | +#ifdef JSON_IN_CPPTL |
| 42 | +#include <cpptl/config.h> |
| 43 | +#ifndef JSON_USE_CPPTL |
| 44 | +#define JSON_USE_CPPTL 1 |
| 45 | +#endif |
| 46 | +#endif |
38 | 47 |
|
39 |
| -# ifdef JSON_IN_CPPTL |
40 |
| -# include <cpptl/config.h> |
41 |
| -# ifndef JSON_USE_CPPTL |
42 |
| -# define JSON_USE_CPPTL 1 |
43 |
| -# endif |
44 |
| -# endif |
45 |
| - |
46 |
| -# ifdef JSON_IN_CPPTL |
47 |
| -# define JSON_API CPPTL_API |
48 |
| -# elif defined(JSON_DLL_BUILD) |
49 |
| -# if defined(_MSC_VER) |
50 |
| -# define JSON_API __declspec(dllexport) |
51 |
| -# define JSONCPP_DISABLE_DLL_INTERFACE_WARNING |
52 |
| -# endif // if defined(_MSC_VER) |
53 |
| -# elif defined(JSON_DLL) |
54 |
| -# if defined(_MSC_VER) |
55 |
| -# define JSON_API __declspec(dllimport) |
56 |
| -# define JSONCPP_DISABLE_DLL_INTERFACE_WARNING |
57 |
| -# endif // if defined(_MSC_VER) |
58 |
| -# endif // ifdef JSON_IN_CPPTL |
59 |
| -# if !defined(JSON_API) |
60 |
| -# define JSON_API |
61 |
| -# endif |
| 48 | +#ifdef JSON_IN_CPPTL |
| 49 | +#define JSON_API CPPTL_API |
| 50 | +#elif defined(JSON_DLL_BUILD) |
| 51 | +#if defined(_MSC_VER) |
| 52 | +#define JSON_API __declspec(dllexport) |
| 53 | +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING |
| 54 | +#endif // if defined(_MSC_VER) |
| 55 | +#elif defined(JSON_DLL) |
| 56 | +#if defined(_MSC_VER) |
| 57 | +#define JSON_API __declspec(dllimport) |
| 58 | +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING |
| 59 | +#endif // if defined(_MSC_VER) |
| 60 | +#endif // ifdef JSON_IN_CPPTL |
| 61 | +#if !defined(JSON_API) |
| 62 | +#define JSON_API |
| 63 | +#endif |
62 | 64 |
|
63 |
| -// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer |
| 65 | +// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for |
| 66 | +// integer |
64 | 67 | // Storages, and 64 bits integer support is disabled.
|
65 | 68 | // #define JSON_NO_INT64 1
|
66 | 69 |
|
67 |
| -#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 |
| 70 | +#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 |
68 | 71 | // Microsoft Visual Studio 6 only support conversion from __int64 to double
|
69 | 72 | // (no conversion from unsigned __int64).
|
70 | 73 | #define JSON_USE_INT64_DOUBLE_CONVERSION 1
|
71 |
| -// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' characters in the debug information) |
72 |
| -// All projects I've ever seen with VS6 were using this globally (not bothering with pragma push/pop). |
| 74 | +// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' |
| 75 | +// characters in the debug information) |
| 76 | +// All projects I've ever seen with VS6 were using this globally (not bothering |
| 77 | +// with pragma push/pop). |
73 | 78 | #pragma warning(disable : 4786)
|
74 | 79 | #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6
|
75 | 80 |
|
76 |
| -#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 |
| 81 | +#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 |
77 | 82 | /// Indicates that the following function is deprecated.
|
78 |
| -# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) |
| 83 | +#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) |
79 | 84 | #endif
|
80 | 85 |
|
81 | 86 | #if !defined(JSONCPP_DEPRECATED)
|
82 |
| -# define JSONCPP_DEPRECATED(message) |
| 87 | +#define JSONCPP_DEPRECATED(message) |
83 | 88 | #endif // if !defined(JSONCPP_DEPRECATED)
|
84 | 89 |
|
85 | 90 | namespace Json {
|
86 |
| - typedef int Int; |
87 |
| - typedef unsigned int UInt; |
88 |
| -# if defined(JSON_NO_INT64) |
89 |
| - typedef int LargestInt; |
90 |
| - typedef unsigned int LargestUInt; |
91 |
| -# undef JSON_HAS_INT64 |
92 |
| -# else // if defined(JSON_NO_INT64) |
93 |
| - // For Microsoft Visual use specific types as long long is not supported |
94 |
| -# if defined(_MSC_VER) // Microsoft Visual Studio |
95 |
| - typedef __int64 Int64; |
96 |
| - typedef unsigned __int64 UInt64; |
97 |
| -# else // if defined(_MSC_VER) // Other platforms, use long long |
98 |
| - typedef long long int Int64; |
99 |
| - typedef unsigned long long int UInt64; |
100 |
| -# endif // if defined(_MSC_VER) |
101 |
| - typedef Int64 LargestInt; |
102 |
| - typedef UInt64 LargestUInt; |
103 |
| -# define JSON_HAS_INT64 |
104 |
| -# endif // if defined(JSON_NO_INT64) |
| 91 | +typedef int Int; |
| 92 | +typedef unsigned int UInt; |
| 93 | +#if defined(JSON_NO_INT64) |
| 94 | +typedef int LargestInt; |
| 95 | +typedef unsigned int LargestUInt; |
| 96 | +#undef JSON_HAS_INT64 |
| 97 | +#else // if defined(JSON_NO_INT64) |
| 98 | +// For Microsoft Visual use specific types as long long is not supported |
| 99 | +#if defined(_MSC_VER) // Microsoft Visual Studio |
| 100 | +typedef __int64 Int64; |
| 101 | +typedef unsigned __int64 UInt64; |
| 102 | +#else // if defined(_MSC_VER) // Other platforms, use long long |
| 103 | +typedef long long int Int64; |
| 104 | +typedef unsigned long long int UInt64; |
| 105 | +#endif // if defined(_MSC_VER) |
| 106 | +typedef Int64 LargestInt; |
| 107 | +typedef UInt64 LargestUInt; |
| 108 | +#define JSON_HAS_INT64 |
| 109 | +#endif // if defined(JSON_NO_INT64) |
105 | 110 | } // end namespace Json
|
106 | 111 |
|
107 |
| - |
108 | 112 | #endif // JSON_CONFIG_H_INCLUDED
|
0 commit comments