Path: blob/master/thirdparty/openxr/src/external/jsoncpp/include/json/config.h
9913 views
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors1// Distributed under MIT license, or public domain if desired and2// recognized in your jurisdiction.3// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE45#ifndef JSON_CONFIG_H_INCLUDED6#define JSON_CONFIG_H_INCLUDED7#include <cstddef>8#include <cstdint>9#include <istream>10#include <memory>11#include <ostream>12#include <sstream>13#include <string>14#include <type_traits>1516// If non-zero, the library uses exceptions to report bad input instead of C17// assertion macros. The default is to use exceptions.18#ifndef JSON_USE_EXCEPTION19#define JSON_USE_EXCEPTION 120#endif2122// Temporary, tracked for removal with issue #982.23#ifndef JSON_USE_NULLREF24#define JSON_USE_NULLREF 125#endif2627/// If defined, indicates that the source file is amalgamated28/// to prevent private header inclusion.29/// Remarks: it is automatically defined in the generated amalgamated header.30// #define JSON_IS_AMALGAMATION3132// Export macros for DLL visibility33#if defined(JSON_DLL_BUILD)34#if defined(_MSC_VER) || defined(__MINGW32__)35#define JSON_API __declspec(dllexport)36#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING37#elif defined(__GNUC__) || defined(__clang__)38#define JSON_API __attribute__((visibility("default")))39#endif // if defined(_MSC_VER)4041#elif defined(JSON_DLL)42#if defined(_MSC_VER) || defined(__MINGW32__)43#define JSON_API __declspec(dllimport)44#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING45#endif // if defined(_MSC_VER)46#endif // ifdef JSON_DLL_BUILD4748#if !defined(JSON_API)49#define JSON_API50#endif5152#if defined(_MSC_VER) && _MSC_VER < 180053#error \54"ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"55#endif5657#if defined(_MSC_VER) && _MSC_VER < 190058// As recommended at59// https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-201060extern JSON_API int msvc_pre1900_c99_snprintf(char* outBuf, size_t size,61const char* format, ...);62#define jsoncpp_snprintf msvc_pre1900_c99_snprintf63#else64#define jsoncpp_snprintf std::snprintf65#endif6667// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for68// integer69// Storages, and 64 bits integer support is disabled.70// #define JSON_NO_INT64 17172// JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools.73// C++11 should be used directly in JSONCPP.74#define JSONCPP_OVERRIDE override7576#ifdef __clang__77#if __has_extension(attribute_deprecated_with_message)78#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))79#endif80#elif defined(__GNUC__) // not clang (gcc comes later since clang emulates gcc)81#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))82#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))83#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))84#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))85#endif // GNUC version86#elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates87// MSVC)88#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))89#endif // __clang__ || __GNUC__ || _MSC_VER9091#if !defined(JSONCPP_DEPRECATED)92#define JSONCPP_DEPRECATED(message)93#endif // if !defined(JSONCPP_DEPRECATED)9495#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6))96#define JSON_USE_INT64_DOUBLE_CONVERSION 197#endif9899#if !defined(JSON_IS_AMALGAMATION)100101#include "allocator.h"102#include "version.h"103104#endif // if !defined(JSON_IS_AMALGAMATION)105106namespace Json {107using Int = int;108using UInt = unsigned int;109#if defined(JSON_NO_INT64)110using LargestInt = int;111using LargestUInt = unsigned int;112#undef JSON_HAS_INT64113#else // if defined(JSON_NO_INT64)114// For Microsoft Visual use specific types as long long is not supported115#if defined(_MSC_VER) // Microsoft Visual Studio116using Int64 = __int64;117using UInt64 = unsigned __int64;118#else // if defined(_MSC_VER) // Other platforms, use long long119using Int64 = int64_t;120using UInt64 = uint64_t;121#endif // if defined(_MSC_VER)122using LargestInt = Int64;123using LargestUInt = UInt64;124#define JSON_HAS_INT64125#endif // if defined(JSON_NO_INT64)126127template <typename T>128using Allocator =129typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator<T>,130std::allocator<T>>::type;131using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;132using IStringStream =133std::basic_istringstream<String::value_type, String::traits_type,134String::allocator_type>;135using OStringStream =136std::basic_ostringstream<String::value_type, String::traits_type,137String::allocator_type>;138using IStream = std::istream;139using OStream = std::ostream;140} // namespace Json141142// Legacy names (formerly macros).143using JSONCPP_STRING = Json::String;144using JSONCPP_ISTRINGSTREAM = Json::IStringStream;145using JSONCPP_OSTRINGSTREAM = Json::OStringStream;146using JSONCPP_ISTREAM = Json::IStream;147using JSONCPP_OSTREAM = Json::OStream;148149#endif // JSON_CONFIG_H_INCLUDED150151152