Christopher Dunn | 6d135cb | 2007-06-13 15:51:04 +0000 | [diff] [blame] | 1 | #ifndef JSON_CONFIG_H_INCLUDED |
| 2 | # define JSON_CONFIG_H_INCLUDED |
| 3 | |
| 4 | /// If defined, indicates that json library is embedded in CppTL library. |
| 5 | //# define JSON_IN_CPPTL 1 |
| 6 | |
| 7 | /// If defined, indicates that json may leverage CppTL library |
| 8 | //# define JSON_USE_CPPTL 1 |
| 9 | /// If defined, indicates that cpptl vector based map should be used instead of std::map |
| 10 | /// as Value container. |
| 11 | //# define JSON_USE_CPPTL_SMALLMAP 1 |
| 12 | /// If defined, indicates that Json specific container should be used |
| 13 | /// (hash table & simple deque container with customizable allocator). |
| 14 | /// THIS FEATURE IS STILL EXPERIMENTAL! |
| 15 | //# define JSON_VALUE_USE_INTERNAL_MAP 1 |
| 16 | /// Force usage of standard new/malloc based allocator instead of memory pool based allocator. |
| 17 | /// The memory pools allocator used optimization (initializing Value and ValueInternalLink |
| 18 | /// as if it was a POD) that may cause some validation tool to report errors. |
| 19 | /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. |
| 20 | //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 |
| 21 | |
Baptiste Lepilleur | 45c499d | 2009-11-21 18:07:09 +0000 | [diff] [blame] | 22 | /// If defined, indicates that Json use exception to report invalid type manipulation |
| 23 | /// instead of C assert macro. |
| 24 | # define JSON_USE_EXCEPTION 1 |
Christopher Dunn | 6d135cb | 2007-06-13 15:51:04 +0000 | [diff] [blame] | 25 | |
| 26 | # ifdef JSON_IN_CPPTL |
| 27 | # include <cpptl/config.h> |
| 28 | # ifndef JSON_USE_CPPTL |
| 29 | # define JSON_USE_CPPTL 1 |
| 30 | # endif |
| 31 | # endif |
| 32 | |
| 33 | # ifdef JSON_IN_CPPTL |
| 34 | # define JSON_API CPPTL_API |
| 35 | # elif defined(JSON_DLL_BUILD) |
| 36 | # define JSON_API __declspec(dllexport) |
| 37 | # elif defined(JSON_DLL) |
| 38 | # define JSON_API __declspec(dllimport) |
| 39 | # else |
| 40 | # define JSON_API |
| 41 | # endif |
| 42 | |
Baptiste Lepilleur | 201fb2c | 2010-04-19 07:37:41 +0000 | [diff] [blame^] | 43 | // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer |
| 44 | // Storages. |
| 45 | // #define JSON_NO_INT64 1 |
| 46 | |
| 47 | #if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 |
| 48 | // Microsoft Visual Studio 6 only support conversion from __int64 to double |
| 49 | // (no conversion from unsigned __int64). |
| 50 | #define JSON_USE_INT64_DOUBLE_CONVERSION 1 |
| 51 | #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 |
| 52 | |
| 53 | |
| 54 | namespace Json { |
| 55 | # if defined(JSON_NO_INT64) |
| 56 | typedef int Int; |
| 57 | typedef unsigned int UInt; |
| 58 | # else // if defined(JSON_NO_INT64) |
| 59 | // For Microsoft Visual use specific types as long long is not supported |
| 60 | # if defined(_MSC_VER) // Microsoft Visual Studio |
| 61 | typedef __int64 Int; |
| 62 | typedef unsigned __int64 UInt; |
| 63 | # else // if defined(_MSC_VER) // Other platforms, use long long |
| 64 | typedef long long int Int; |
| 65 | typedef unsigned long long int UInt; |
| 66 | # endif // if defined(_MSC_VER) |
| 67 | # endif // if defined(JSON_NO_INT64) |
| 68 | } // end namespace Json |
| 69 | |
| 70 | |
Christopher Dunn | 6d135cb | 2007-06-13 15:51:04 +0000 | [diff] [blame] | 71 | #endif // JSON_CONFIG_H_INCLUDED |