JsonCpp project page JsonCpp home page

include/json/config.h

Go to the documentation of this file.
00001 // Copyright 2007-2010 Baptiste Lepilleur
00002 // Distributed under MIT license, or public domain if desired and
00003 // recognized in your jurisdiction.
00004 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
00005 
00006 #ifndef JSON_CONFIG_H_INCLUDED
00007 #define JSON_CONFIG_H_INCLUDED
00008 
00010 //# define JSON_IN_CPPTL 1
00011 
00013 //#  define JSON_USE_CPPTL 1
00017 //#  define JSON_USE_CPPTL_SMALLMAP 1
00018 
00019 // If non-zero, the library uses exceptions to report bad input instead of C
00020 // assertion macros. The default is to use exceptions.
00021 #ifndef JSON_USE_EXCEPTION
00022 #define JSON_USE_EXCEPTION 1
00023 #endif
00024 
00028 // #define JSON_IS_AMALGAMATION
00029 
00030 #ifdef JSON_IN_CPPTL
00031 #include <cpptl/config.h>
00032 #ifndef JSON_USE_CPPTL
00033 #define JSON_USE_CPPTL 1
00034 #endif
00035 #endif
00036 
00037 #ifdef JSON_IN_CPPTL
00038 #define JSON_API CPPTL_API
00039 #elif defined(JSON_DLL_BUILD)
00040 #if defined(_MSC_VER)
00041 #define JSON_API __declspec(dllexport)
00042 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
00043 #endif // if defined(_MSC_VER)
00044 #elif defined(JSON_DLL)
00045 #if defined(_MSC_VER)
00046 #define JSON_API __declspec(dllimport)
00047 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
00048 #endif // if defined(_MSC_VER)
00049 #endif // ifdef JSON_IN_CPPTL
00050 #if !defined(JSON_API)
00051 #define JSON_API
00052 #endif
00053 
00054 // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
00055 // integer
00056 // Storages, and 64 bits integer support is disabled.
00057 // #define JSON_NO_INT64 1
00058 
00059 #if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6
00060 // Microsoft Visual Studio 6 only support conversion from __int64 to double
00061 // (no conversion from unsigned __int64).
00062 #define JSON_USE_INT64_DOUBLE_CONVERSION 1
00063 // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
00064 // characters in the debug information)
00065 // All projects I've ever seen with VS6 were using this globally (not bothering
00066 // with pragma push/pop).
00067 #pragma warning(disable : 4786)
00068 #endif // if defined(_MSC_VER)  &&  _MSC_VER < 1200 // MSVC 6
00069 
00070 #if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008
00071 
00072 #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
00073 #elif defined(__clang__) && defined(__has_feature)
00074 #if __has_feature(attribute_deprecated_with_message)
00075 #define JSONCPP_DEPRECATED(message)  __attribute__ ((deprecated(message)))
00076 #endif
00077 #elif defined(__GNUC__) &&  (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
00078 #define JSONCPP_DEPRECATED(message)  __attribute__ ((deprecated(message)))
00079 #elif defined(__GNUC__) &&  (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
00080 #define JSONCPP_DEPRECATED(message)  __attribute__((__deprecated__))
00081 #endif
00082 
00083 #if !defined(JSONCPP_DEPRECATED)
00084 #define JSONCPP_DEPRECATED(message)
00085 #endif // if !defined(JSONCPP_DEPRECATED)
00086 
00087 namespace Json {
00088 typedef int Int;
00089 typedef unsigned int UInt;
00090 #if defined(JSON_NO_INT64)
00091 typedef int LargestInt;
00092 typedef unsigned int LargestUInt;
00093 #undef JSON_HAS_INT64
00094 #else                 // if defined(JSON_NO_INT64)
00095 // For Microsoft Visual use specific types as long long is not supported
00096 #if defined(_MSC_VER) // Microsoft Visual Studio
00097 typedef __int64 Int64;
00098 typedef unsigned __int64 UInt64;
00099 #else                 // if defined(_MSC_VER) // Other platforms, use long long
00100 typedef long long int Int64;
00101 typedef unsigned long long int UInt64;
00102 #endif // if defined(_MSC_VER)
00103 typedef Int64 LargestInt;
00104 typedef UInt64 LargestUInt;
00105 #define JSON_HAS_INT64
00106 #endif // if defined(JSON_NO_INT64)
00107 } // end namespace Json
00108 
00109 #endif // JSON_CONFIG_H_INCLUDED