config.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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, indicates that json library is embedded in CppTL library.
  10. //# define JSON_IN_CPPTL 1
  11. /// If defined, indicates that json may leverage CppTL library
  12. //# define JSON_USE_CPPTL 1
  13. /// If defined, indicates that cpptl vector based map should be used instead of
  14. /// std::map
  15. /// as Value container.
  16. //# define JSON_USE_CPPTL_SMALLMAP 1
  17. /// If defined, indicates that Json specific container should be used
  18. /// (hash table & simple deque container with customizable allocator).
  19. /// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332
  20. //# define JSON_VALUE_USE_INTERNAL_MAP 1
  21. /// Force usage of standard new/malloc based allocator instead of memory pool
  22. /// based allocator.
  23. /// The memory pools allocator used optimization (initializing Value and
  24. /// ValueInternalLink
  25. /// as if it was a POD) that may cause some validation tool to report errors.
  26. /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.
  27. //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1
  28. // If non-zero, the library uses exceptions to report bad input instead of C
  29. // assertion macros. The default is to use exceptions.
  30. #ifndef JSON_USE_EXCEPTION
  31. #define JSON_USE_EXCEPTION 1
  32. #endif
  33. /// If defined, indicates that the source file is amalgated
  34. /// to prevent private header inclusion.
  35. /// Remarks: it is automatically defined in the generated amalgated header.
  36. // #define JSON_IS_AMALGAMATION
  37. #ifdef JSON_IN_CPPTL
  38. #include <cpptl/config.h>
  39. #ifndef JSON_USE_CPPTL
  40. #define JSON_USE_CPPTL 1
  41. #endif
  42. #endif
  43. #ifdef JSON_IN_CPPTL
  44. #define JSON_API CPPTL_API
  45. #elif defined(JSON_DLL_BUILD)
  46. #if defined(_MSC_VER)
  47. #define JSON_API __declspec(dllexport)
  48. #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
  49. #endif // if defined(_MSC_VER)
  50. #elif defined(JSON_DLL)
  51. #if defined(_MSC_VER)
  52. #define JSON_API __declspec(dllimport)
  53. #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
  54. #endif // if defined(_MSC_VER)
  55. #endif // ifdef JSON_IN_CPPTL
  56. #if !defined(JSON_API)
  57. #define JSON_API
  58. #endif
  59. // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
  60. // integer
  61. // Storages, and 64 bits integer support is disabled.
  62. // #define JSON_NO_INT64 1
  63. #if defined(_MSC_VER) && _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 // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6
  73. #if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008
  74. /// Indicates that the following function is deprecated.
  75. #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
  76. #endif
  77. #if !defined(JSONCPP_DEPRECATED)
  78. #define JSONCPP_DEPRECATED(message)
  79. #endif // if !defined(JSONCPP_DEPRECATED)
  80. namespace Json {
  81. typedef int Int;
  82. typedef unsigned int UInt;
  83. #if defined(JSON_NO_INT64)
  84. typedef int LargestInt;
  85. typedef unsigned int LargestUInt;
  86. #undef JSON_HAS_INT64
  87. #else // if defined(JSON_NO_INT64)
  88. // For Microsoft Visual use specific types as long long is not supported
  89. #if defined(_MSC_VER) // Microsoft Visual Studio
  90. typedef __int64 Int64;
  91. typedef unsigned __int64 UInt64;
  92. #else // if defined(_MSC_VER) // Other platforms, use long long
  93. typedef long long int Int64;
  94. typedef unsigned long long int UInt64;
  95. #endif // if defined(_MSC_VER)
  96. typedef Int64 LargestInt;
  97. typedef UInt64 LargestUInt;
  98. #define JSON_HAS_INT64
  99. #endif // if defined(JSON_NO_INT64)
  100. } // end namespace Json
  101. #endif // JSON_CONFIG_H_INCLUDED