config.h 4.0 KB

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