config.h 3.4 KB

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