From 1720bfedd14ca8225fb4cb33d6d08551ce296237 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 30 Jun 2019 22:14:02 +0200 Subject: [PATCH 1/7] :alembic: add Hedley annotations --- .../nlohmann/detail/conversions/from_json.hpp | 26 +- .../nlohmann/detail/conversions/to_chars.hpp | 9 + .../nlohmann/detail/conversions/to_json.hpp | 2 +- include/nlohmann/detail/exceptions.hpp | 7 + .../nlohmann/detail/input/binary_reader.hpp | 114 +- .../nlohmann/detail/input/input_adapters.hpp | 7 +- include/nlohmann/detail/input/json_sax.hpp | 9 +- include/nlohmann/detail/input/lexer.hpp | 38 +- include/nlohmann/detail/input/parser.hpp | 46 +- .../nlohmann/detail/iterators/iter_impl.hpp | 28 +- include/nlohmann/detail/json_pointer.hpp | 34 +- include/nlohmann/detail/macro_scope.hpp | 36 +- include/nlohmann/detail/macro_unscope.hpp | 4 - .../nlohmann/detail/output/binary_writer.hpp | 3 +- .../detail/output/output_adapters.hpp | 4 + include/nlohmann/detail/output/serializer.hpp | 6 +- include/nlohmann/json.hpp | 165 +- include/nlohmann/thirdparty/hedley/hedley.hpp | 1505 +++++++++++ single_include/nlohmann/json.hpp | 2288 ++++++++++++++--- 19 files changed, 3689 insertions(+), 642 deletions(-) create mode 100644 include/nlohmann/thirdparty/hedley/hedley.hpp diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index 08a841b4..b7848c9e 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -26,7 +26,7 @@ namespace detail template void from_json(const BasicJsonType& j, typename std::nullptr_t& n) { - if (JSON_UNLIKELY(not j.is_null())) + if (HEDLEY_UNLIKELY(not j.is_null())) { JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); } @@ -66,7 +66,7 @@ void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) template void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) { - if (JSON_UNLIKELY(not j.is_boolean())) + if (HEDLEY_UNLIKELY(not j.is_boolean())) { JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); } @@ -76,7 +76,7 @@ void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) template void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) { - if (JSON_UNLIKELY(not j.is_string())) + if (HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -92,7 +92,7 @@ template < int > = 0 > void from_json(const BasicJsonType& j, ConstructibleStringType& s) { - if (JSON_UNLIKELY(not j.is_string())) + if (HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -132,7 +132,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::forward_list& l) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -149,7 +149,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::valarray& l) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -236,7 +236,7 @@ auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) j.template get(), void()) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); @@ -249,7 +249,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) { - if (JSON_UNLIKELY(not j.is_object())) + if (HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); } @@ -332,14 +332,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::map& m) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (JSON_UNLIKELY(not p.is_array())) + if (HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -352,14 +352,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::unordered_map& m) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (JSON_UNLIKELY(not p.is_array())) + if (HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -386,4 +386,4 @@ namespace { constexpr const auto& from_json = detail::static_const::value; } // namespace -} // namespace nlohmann +} // namespace nlohmann diff --git a/include/nlohmann/detail/conversions/to_chars.hpp b/include/nlohmann/detail/conversions/to_chars.hpp index 2a264a87..6edc57ff 100644 --- a/include/nlohmann/detail/conversions/to_chars.hpp +++ b/include/nlohmann/detail/conversions/to_chars.hpp @@ -8,6 +8,7 @@ #include // memcpy, memmove #include // numeric_limits #include // conditional +#include namespace nlohmann { @@ -818,6 +819,7 @@ v = buf * 10^decimal_exponent len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ +HEDLEY_NON_NULL(1) inline void grisu2(char* buf, int& len, int& decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) { @@ -877,6 +879,7 @@ len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ template +HEDLEY_NON_NULL(1) void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) { static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, @@ -915,6 +918,8 @@ void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) @return a pointer to the element following the exponent. @pre -1000 < e < 1000 */ +HEDLEY_NON_NULL(1) +HEDLEY_RETURNS_NON_NULL inline char* append_exponent(char* buf, int e) { assert(e > -1000); @@ -965,6 +970,8 @@ notation. Otherwise it will be printed in exponential notation. @pre min_exp < 0 @pre max_exp > 0 */ +HEDLEY_NON_NULL(1) +HEDLEY_RETURNS_NON_NULL inline char* format_buffer(char* buf, int len, int decimal_exponent, int min_exp, int max_exp) { @@ -1048,6 +1055,8 @@ format. Returns an iterator pointing past-the-end of the decimal representation. @note The result is NOT null-terminated. */ template +HEDLEY_NON_NULL(1, 2) +HEDLEY_RETURNS_NON_NULL char* to_chars(char* first, const char* last, FloatType value) { static_cast(last); // maybe unused - fix warning diff --git a/include/nlohmann/detail/conversions/to_json.hpp b/include/nlohmann/detail/conversions/to_json.hpp index 227d7455..db9eaf2b 100644 --- a/include/nlohmann/detail/conversions/to_json.hpp +++ b/include/nlohmann/detail/conversions/to_json.hpp @@ -341,4 +341,4 @@ namespace { constexpr const auto& to_json = detail::static_const::value; } // namespace -} // namespace nlohmann +} // namespace nlohmann diff --git a/include/nlohmann/detail/exceptions.hpp b/include/nlohmann/detail/exceptions.hpp index 519a5975..bff13194 100644 --- a/include/nlohmann/detail/exceptions.hpp +++ b/include/nlohmann/detail/exceptions.hpp @@ -5,6 +5,7 @@ #include // to_string #include +#include namespace nlohmann { @@ -46,6 +47,7 @@ class exception : public std::exception { public: /// returns the explanatory string + HEDLEY_RETURNS_NON_NULL const char* what() const noexcept override { return m.what(); @@ -55,6 +57,7 @@ class exception : public std::exception const int id; protected: + HEDLEY_NON_NULL(3) exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} static std::string name(const std::string& ename, int id_) @@ -207,6 +210,7 @@ class invalid_iterator : public exception } private: + HEDLEY_NON_NULL(3) invalid_iterator(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -260,6 +264,7 @@ class type_error : public exception } private: + HEDLEY_NON_NULL(3) type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -306,6 +311,7 @@ class out_of_range : public exception } private: + HEDLEY_NON_NULL(3) out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -343,6 +349,7 @@ class other_error : public exception } private: + HEDLEY_NON_NULL(3) other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; } // namespace detail diff --git a/include/nlohmann/detail/input/binary_reader.hpp b/include/nlohmann/detail/input/binary_reader.hpp index 42976d70..33af9c36 100644 --- a/include/nlohmann/detail/input/binary_reader.hpp +++ b/include/nlohmann/detail/input/binary_reader.hpp @@ -66,6 +66,7 @@ class binary_reader @return */ + HEDLEY_NON_NULL(3) bool sax_parse(const input_format_t format, json_sax_t* sax_, const bool strict = true) @@ -107,7 +108,7 @@ class binary_reader get(); } - if (JSON_UNLIKELY(current != std::char_traits::eof())) + if (HEDLEY_UNLIKELY(current != std::char_traits::eof())) { return sax->parse_error(chars_read, get_token_string(), parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); @@ -143,12 +144,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (JSON_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } - if (JSON_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) + if (HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) { return false; } @@ -169,7 +170,7 @@ class binary_reader while (true) { get(); - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) { return false; } @@ -197,7 +198,7 @@ class binary_reader template bool get_bson_string(const NumberType len, string_t& result) { - if (JSON_UNLIKELY(len < 1)) + if (HEDLEY_UNLIKELY(len < 1)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); @@ -292,13 +293,13 @@ class binary_reader string_t key; while (int element_type = get()) { - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) { return false; } const std::size_t element_type_parse_position = chars_read; - if (JSON_UNLIKELY(not get_bson_cstr(key))) + if (HEDLEY_UNLIKELY(not get_bson_cstr(key))) { return false; } @@ -308,7 +309,7 @@ class binary_reader return false; } - if (JSON_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) + if (HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) { return false; } @@ -329,12 +330,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (JSON_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } - if (JSON_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) + if (HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) { return false; } @@ -619,12 +620,12 @@ class binary_reader case 0xF9: // Half-Precision Float (two-byte IEEE 754) { const int byte1_raw = get(); - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } const int byte2_raw = get(); - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } @@ -697,7 +698,7 @@ class binary_reader */ bool get_cbor_string(string_t& result) { - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) { return false; } @@ -786,7 +787,7 @@ class binary_reader */ bool get_cbor_array(const std::size_t len) { - if (JSON_UNLIKELY(not sax->start_array(len))) + if (HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } @@ -795,7 +796,7 @@ class binary_reader { for (std::size_t i = 0; i < len; ++i) { - if (JSON_UNLIKELY(not parse_cbor_internal())) + if (HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -805,7 +806,7 @@ class binary_reader { while (get() != 0xFF) { - if (JSON_UNLIKELY(not parse_cbor_internal(false))) + if (HEDLEY_UNLIKELY(not parse_cbor_internal(false))) { return false; } @@ -822,7 +823,7 @@ class binary_reader */ bool get_cbor_object(const std::size_t len) { - if (JSON_UNLIKELY(not sax->start_object(len))) + if (HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -833,12 +834,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_cbor_internal())) + if (HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -849,12 +850,12 @@ class binary_reader { while (get() != 0xFF) { - if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_cbor_internal())) + if (HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -1243,7 +1244,7 @@ class binary_reader */ bool get_msgpack_string(string_t& result) { - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) { return false; } @@ -1319,14 +1320,14 @@ class binary_reader */ bool get_msgpack_array(const std::size_t len) { - if (JSON_UNLIKELY(not sax->start_array(len))) + if (HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } for (std::size_t i = 0; i < len; ++i) { - if (JSON_UNLIKELY(not parse_msgpack_internal())) + if (HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -1341,7 +1342,7 @@ class binary_reader */ bool get_msgpack_object(const std::size_t len) { - if (JSON_UNLIKELY(not sax->start_object(len))) + if (HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -1350,12 +1351,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (JSON_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_msgpack_internal())) + if (HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -1402,7 +1403,7 @@ class binary_reader get(); // TODO(niels): may we ignore N here? } - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -1456,7 +1457,7 @@ class binary_reader case 'U': { std::uint8_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1467,7 +1468,7 @@ class binary_reader case 'i': { std::int8_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1478,7 +1479,7 @@ class binary_reader case 'I': { std::int16_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1489,7 +1490,7 @@ class binary_reader case 'l': { std::int32_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1500,7 +1501,7 @@ class binary_reader case 'L': { std::int64_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1536,15 +1537,15 @@ class binary_reader if (current == '$') { result.second = get(); // must not ignore 'N', because 'N' maybe the type - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) { return false; } get_ignore_noop(); - if (JSON_UNLIKELY(current != '#')) + if (HEDLEY_UNLIKELY(current != '#')) { - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -1627,11 +1628,11 @@ class binary_reader case 'C': // char { get(); - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) { return false; } - if (JSON_UNLIKELY(current > 127)) + if (HEDLEY_UNLIKELY(current > 127)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); @@ -1666,14 +1667,14 @@ class binary_reader bool get_ubjson_array() { std::pair size_and_type; - if (JSON_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } if (size_and_type.first != string_t::npos) { - if (JSON_UNLIKELY(not sax->start_array(size_and_type.first))) + if (HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) { return false; } @@ -1684,7 +1685,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -1695,7 +1696,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (JSON_UNLIKELY(not parse_ubjson_internal())) + if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1704,14 +1705,14 @@ class binary_reader } else { - if (JSON_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } while (current != ']') { - if (JSON_UNLIKELY(not parse_ubjson_internal(false))) + if (HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) { return false; } @@ -1728,7 +1729,7 @@ class binary_reader bool get_ubjson_object() { std::pair size_and_type; - if (JSON_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } @@ -1736,7 +1737,7 @@ class binary_reader string_t key; if (size_and_type.first != string_t::npos) { - if (JSON_UNLIKELY(not sax->start_object(size_and_type.first))) + if (HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) { return false; } @@ -1745,11 +1746,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -1760,11 +1761,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_ubjson_internal())) + if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1774,18 +1775,18 @@ class binary_reader } else { - if (JSON_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } while (current != '}') { - if (JSON_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_ubjson_internal())) + if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1851,7 +1852,7 @@ class binary_reader for (std::size_t i = 0; i < sizeof(NumberType); ++i) { get(); - if (JSON_UNLIKELY(not unexpect_eof(format, "number"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) { return false; } @@ -1895,7 +1896,7 @@ class binary_reader std::generate_n(std::back_inserter(result), len, [this, &success, &format]() { get(); - if (JSON_UNLIKELY(not unexpect_eof(format, "string"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) { success = false; } @@ -1909,9 +1910,10 @@ class binary_reader @param[in] context further context information (for diagnostics) @return whether the last read character is not EOF */ + HEDLEY_NON_NULL(3) bool unexpect_eof(const input_format_t format, const char* context) const { - if (JSON_UNLIKELY(current == std::char_traits::eof())) + if (HEDLEY_UNLIKELY(current == std::char_traits::eof())) { return sax->parse_error(chars_read, "", parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index 5d9e200e..487cb525 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -55,6 +55,7 @@ Input adapter for stdio file access. This adapter read only 1 byte and do not us class file_input_adapter : public input_adapter_protocol { public: + HEDLEY_NON_NULL(2) explicit file_input_adapter(std::FILE* f) noexcept : m_file(f) {} @@ -130,6 +131,7 @@ class input_stream_adapter : public input_adapter_protocol class input_buffer_adapter : public input_adapter_protocol { public: + HEDLEY_NON_NULL(2) input_buffer_adapter(const char* b, const std::size_t l) noexcept : cursor(b), limit(b + l) {} @@ -143,7 +145,7 @@ class input_buffer_adapter : public input_adapter_protocol std::char_traits::int_type get_character() noexcept override { - if (JSON_LIKELY(cursor < limit)) + if (HEDLEY_LIKELY(cursor < limit)) { return std::char_traits::to_int_type(*(cursor++)); } @@ -333,6 +335,7 @@ class input_adapter { public: // native support + HEDLEY_NON_NULL(2) input_adapter(std::FILE* file) : ia(std::make_shared(file)) {} /// input adapter for input stream @@ -401,7 +404,7 @@ class input_adapter "each element in the iterator range must have the size of 1 byte"); const auto len = static_cast(std::distance(first, last)); - if (JSON_LIKELY(len > 0)) + if (HEDLEY_LIKELY(len > 0)) { // there is at least one element: use the address of first ia = std::make_shared(reinterpret_cast(&(*first)), len); diff --git a/include/nlohmann/detail/input/json_sax.hpp b/include/nlohmann/detail/input/json_sax.hpp index 66651a90..b4cd1c9b 100644 --- a/include/nlohmann/detail/input/json_sax.hpp +++ b/include/nlohmann/detail/input/json_sax.hpp @@ -206,7 +206,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); - if (JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); @@ -232,7 +232,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); - if (JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); @@ -288,6 +288,7 @@ class json_sax_dom_parser object to which we can add elements */ template + HEDLEY_RETURNS_NON_NULL BasicJsonType* handle_value(Value&& v) { if (ref_stack.empty()) @@ -394,7 +395,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check object limit - if (ref_stack.back() and JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); } @@ -457,7 +458,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check array limit - if (ref_stack.back() and JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); } diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index c135420f..04b9a31e 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -59,6 +59,7 @@ class lexer }; /// return name of values of type token_type (only used for errors) + HEDLEY_RETURNS_NON_NULL static const char* token_type_name(const token_type t) noexcept { switch (t) @@ -200,7 +201,7 @@ class lexer for (auto range = ranges.begin(); range != ranges.end(); ++range) { get(); - if (JSON_LIKELY(*range <= current and current <= *(++range))) + if (HEDLEY_LIKELY(*range <= current and current <= *(++range))) { add(current); } @@ -299,7 +300,7 @@ class lexer const int codepoint1 = get_codepoint(); int codepoint = codepoint1; // start with codepoint1 - if (JSON_UNLIKELY(codepoint1 == -1)) + if (HEDLEY_UNLIKELY(codepoint1 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; @@ -309,18 +310,18 @@ class lexer if (0xD800 <= codepoint1 and codepoint1 <= 0xDBFF) { // expect next \uxxxx entry - if (JSON_LIKELY(get() == '\\' and get() == 'u')) + if (HEDLEY_LIKELY(get() == '\\' and get() == 'u')) { const int codepoint2 = get_codepoint(); - if (JSON_UNLIKELY(codepoint2 == -1)) + if (HEDLEY_UNLIKELY(codepoint2 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; } // check if codepoint2 is a low surrogate - if (JSON_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) + if (HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) { // overwrite codepoint codepoint = static_cast( @@ -347,7 +348,7 @@ class lexer } else { - if (JSON_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) + if (HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) { error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; return token_type::parse_error; @@ -722,7 +723,7 @@ class lexer case 0xDE: case 0xDF: { - if (JSON_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) + if (HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) { return token_type::parse_error; } @@ -732,7 +733,7 @@ class lexer // U+0800..U+0FFF: bytes E0 A0..BF 80..BF case 0xE0: { - if (JSON_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -756,7 +757,7 @@ class lexer case 0xEE: case 0xEF: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -766,7 +767,7 @@ class lexer // U+D000..U+D7FF: bytes ED 80..9F 80..BF case 0xED: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -776,7 +777,7 @@ class lexer // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF case 0xF0: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -788,7 +789,7 @@ class lexer case 0xF2: case 0xF3: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -798,7 +799,7 @@ class lexer // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF case 0xF4: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -815,16 +816,19 @@ class lexer } } + HEDLEY_NON_NULL(2) static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } + HEDLEY_NON_NULL(2) static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } + HEDLEY_NON_NULL(2) static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); @@ -1200,13 +1204,14 @@ scan_number_done: @param[in] length the length of the passed literal text @param[in] return_type the token type to return on success */ + HEDLEY_NON_NULL(2) token_type scan_literal(const char* literal_text, const std::size_t length, token_type return_type) { assert(current == literal_text[0]); for (std::size_t i = 1; i < length; ++i) { - if (JSON_UNLIKELY(get() != literal_text[i])) + if (HEDLEY_UNLIKELY(get() != literal_text[i])) { error_message = "invalid literal"; return token_type::parse_error; @@ -1252,7 +1257,7 @@ scan_number_done: current = ia->get_character(); } - if (JSON_LIKELY(current != std::char_traits::eof())) + if (HEDLEY_LIKELY(current != std::char_traits::eof())) { token_string.push_back(std::char_traits::to_char_type(current)); } @@ -1293,7 +1298,7 @@ scan_number_done: --position.chars_read_current_line; } - if (JSON_LIKELY(current != std::char_traits::eof())) + if (HEDLEY_LIKELY(current != std::char_traits::eof())) { assert(not token_string.empty()); token_string.pop_back(); @@ -1372,6 +1377,7 @@ scan_number_done: } /// return syntax error message + HEDLEY_RETURNS_NON_NULL constexpr const char* get_error_message() const noexcept { return error_message; diff --git a/include/nlohmann/detail/input/parser.hpp b/include/nlohmann/detail/input/parser.hpp index 6c03181e..55a972e3 100644 --- a/include/nlohmann/detail/input/parser.hpp +++ b/include/nlohmann/detail/input/parser.hpp @@ -147,6 +147,7 @@ class parser } template + HEDLEY_NON_NULL(2) bool sax_parse(SAX* sax, const bool strict = true) { (void)detail::is_sax_static_asserts {}; @@ -166,6 +167,7 @@ class parser private: template + HEDLEY_NON_NULL(2) bool sax_parse_internal(SAX* sax) { // stack to remember the hierarchy of structured values we are parsing @@ -183,7 +185,7 @@ class parser { case token_type::begin_object: { - if (JSON_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } @@ -191,7 +193,7 @@ class parser // closing } -> we are done if (get_token() == token_type::end_object) { - if (JSON_UNLIKELY(not sax->end_object())) + if (HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -199,20 +201,20 @@ class parser } // parse key - if (JSON_UNLIKELY(last_token != token_type::value_string)) + if (HEDLEY_UNLIKELY(last_token != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"))); } - if (JSON_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (JSON_UNLIKELY(get_token() != token_type::name_separator)) + if (HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -230,7 +232,7 @@ class parser case token_type::begin_array: { - if (JSON_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } @@ -238,7 +240,7 @@ class parser // closing ] -> we are done if (get_token() == token_type::end_array) { - if (JSON_UNLIKELY(not sax->end_array())) + if (HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -256,14 +258,14 @@ class parser { const auto res = m_lexer.get_number_float(); - if (JSON_UNLIKELY(not std::isfinite(res))) + if (HEDLEY_UNLIKELY(not std::isfinite(res))) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); } - if (JSON_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) + if (HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) { return false; } @@ -273,7 +275,7 @@ class parser case token_type::literal_false: { - if (JSON_UNLIKELY(not sax->boolean(false))) + if (HEDLEY_UNLIKELY(not sax->boolean(false))) { return false; } @@ -282,7 +284,7 @@ class parser case token_type::literal_null: { - if (JSON_UNLIKELY(not sax->null())) + if (HEDLEY_UNLIKELY(not sax->null())) { return false; } @@ -291,7 +293,7 @@ class parser case token_type::literal_true: { - if (JSON_UNLIKELY(not sax->boolean(true))) + if (HEDLEY_UNLIKELY(not sax->boolean(true))) { return false; } @@ -300,7 +302,7 @@ class parser case token_type::value_integer: { - if (JSON_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) + if (HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) { return false; } @@ -309,7 +311,7 @@ class parser case token_type::value_string: { - if (JSON_UNLIKELY(not sax->string(m_lexer.get_string()))) + if (HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) { return false; } @@ -318,7 +320,7 @@ class parser case token_type::value_unsigned: { - if (JSON_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) + if (HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) { return false; } @@ -366,9 +368,9 @@ class parser } // closing ] - if (JSON_LIKELY(last_token == token_type::end_array)) + if (HEDLEY_LIKELY(last_token == token_type::end_array)) { - if (JSON_UNLIKELY(not sax->end_array())) + if (HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -394,7 +396,7 @@ class parser if (get_token() == token_type::value_separator) { // parse key - if (JSON_UNLIKELY(get_token() != token_type::value_string)) + if (HEDLEY_UNLIKELY(get_token() != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -402,13 +404,13 @@ class parser exception_message(token_type::value_string, "object key"))); } - if (JSON_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (JSON_UNLIKELY(get_token() != token_type::name_separator)) + if (HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -422,9 +424,9 @@ class parser } // closing } - if (JSON_LIKELY(last_token == token_type::end_object)) + if (HEDLEY_LIKELY(last_token == token_type::end_object)) { - if (JSON_UNLIKELY(not sax->end_object())) + if (HEDLEY_UNLIKELY(not sax->end_object())) { return false; } diff --git a/include/nlohmann/detail/iterators/iter_impl.hpp b/include/nlohmann/detail/iterators/iter_impl.hpp index bc87de29..af03cb60 100644 --- a/include/nlohmann/detail/iterators/iter_impl.hpp +++ b/include/nlohmann/detail/iterators/iter_impl.hpp @@ -126,7 +126,8 @@ class iter_impl information refer to: https://github.com/nlohmann/json/issues/1608 */ iter_impl(const iter_impl& other) noexcept - : m_object(other.m_object), m_it(other.m_it) {} + : m_object(other.m_object), m_it(other.m_it) + {} /*! @brief converting constructor @@ -134,7 +135,8 @@ class iter_impl @note It is not checked whether @a other is initialized. */ iter_impl(const iter_impl::type>& other) noexcept - : m_object(other.m_object), m_it(other.m_it) {} + : m_object(other.m_object), m_it(other.m_it) + {} /*! @brief converting assignment @@ -149,6 +151,14 @@ class iter_impl return *this; } + /// @copydoc operator=(const iter_impl::type>&) + iter_impl& operator=(const iter_impl& other) noexcept + { + m_object = other.m_object; + m_it = other.m_it; + return *this; + } + private: /*! @brief set the iterator to the first value @@ -245,7 +255,7 @@ class iter_impl default: { - if (JSON_LIKELY(m_it.primitive_iterator.is_begin())) + if (HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return *m_object; } @@ -279,7 +289,7 @@ class iter_impl default: { - if (JSON_LIKELY(m_it.primitive_iterator.is_begin())) + if (HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return m_object; } @@ -382,7 +392,7 @@ class iter_impl bool operator==(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (JSON_UNLIKELY(m_object != other.m_object)) + if (HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -418,7 +428,7 @@ class iter_impl bool operator<(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (JSON_UNLIKELY(m_object != other.m_object)) + if (HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -578,7 +588,7 @@ class iter_impl default: { - if (JSON_LIKELY(m_it.primitive_iterator.get_value() == -n)) + if (HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) { return *m_object; } @@ -596,7 +606,7 @@ class iter_impl { assert(m_object != nullptr); - if (JSON_LIKELY(m_object->is_object())) + if (HEDLEY_LIKELY(m_object->is_object())) { return m_it.object_iterator->first; } @@ -619,5 +629,5 @@ class iter_impl /// the actual iterator of the associated instance internal_iterator::type> m_it {}; }; -} // namespace detail +} // namespace detail } // namespace nlohmann diff --git a/include/nlohmann/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp index 465e5165..644504b4 100644 --- a/include/nlohmann/detail/json_pointer.hpp +++ b/include/nlohmann/detail/json_pointer.hpp @@ -244,7 +244,7 @@ class json_pointer */ void pop_back() { - if (JSON_UNLIKELY(empty())) + if (HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -268,7 +268,7 @@ class json_pointer */ const std::string& back() { - if (JSON_UNLIKELY(empty())) + if (HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -332,7 +332,7 @@ class json_pointer const int res = std::stoi(s, &processed_chars); // check if the string was completely read - if (JSON_UNLIKELY(processed_chars != s.size())) + if (HEDLEY_UNLIKELY(processed_chars != s.size())) { JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); } @@ -342,7 +342,7 @@ class json_pointer json_pointer top() const { - if (JSON_UNLIKELY(empty())) + if (HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -474,7 +474,7 @@ class json_pointer case detail::value_t::array: { // error condition (cf. RFC 6901, Sect. 4) - if (JSON_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -532,7 +532,7 @@ class json_pointer case detail::value_t::array: { - if (JSON_UNLIKELY(reference_token == "-")) + if (HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -541,7 +541,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (JSON_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -597,7 +597,7 @@ class json_pointer case detail::value_t::array: { - if (JSON_UNLIKELY(reference_token == "-")) + if (HEDLEY_UNLIKELY(reference_token == "-")) { // "-" cannot be used for const access JSON_THROW(detail::out_of_range::create(402, @@ -606,7 +606,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (JSON_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -656,7 +656,7 @@ class json_pointer case detail::value_t::array: { - if (JSON_UNLIKELY(reference_token == "-")) + if (HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -665,7 +665,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (JSON_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -712,7 +712,7 @@ class json_pointer } // check if nonempty reference string begins with slash - if (JSON_UNLIKELY(reference_string[0] != '/')) + if (HEDLEY_UNLIKELY(reference_string[0] != '/')) { JSON_THROW(detail::parse_error::create(107, 1, "JSON pointer must be empty or begin with '/' - was: '" + @@ -747,9 +747,9 @@ class json_pointer assert(reference_token[pos] == '~'); // ~ must be followed by 0 or 1 - if (JSON_UNLIKELY(pos == reference_token.size() - 1 or - (reference_token[pos + 1] != '0' and - reference_token[pos + 1] != '1'))) + if (HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or + (reference_token[pos + 1] != '0' and + reference_token[pos + 1] != '1'))) { JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); } @@ -874,7 +874,7 @@ class json_pointer static BasicJsonType unflatten(const BasicJsonType& value) { - if (JSON_UNLIKELY(not value.is_object())) + if (HEDLEY_UNLIKELY(not value.is_object())) { JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); } @@ -884,7 +884,7 @@ class json_pointer // iterate the JSON object values for (const auto& element : *value.m_value.object) { - if (JSON_UNLIKELY(not element.second.is_primitive())) + if (HEDLEY_UNLIKELY(not element.second.is_primitive())) { JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); } diff --git a/include/nlohmann/detail/macro_scope.hpp b/include/nlohmann/detail/macro_scope.hpp index e41180a9..2be7581d 100644 --- a/include/nlohmann/detail/macro_scope.hpp +++ b/include/nlohmann/detail/macro_scope.hpp @@ -1,6 +1,7 @@ #pragma once #include // pair +#include // This file contains all internal macro definitions // You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them @@ -38,32 +39,6 @@ #pragma GCC diagnostic ignored "-Wdocumentation" #endif -// allow for portable deprecation warnings -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) - #define JSON_DEPRECATED __declspec(deprecated) -#else - #define JSON_DEPRECATED -#endif - -// allow for portable nodiscard warnings -#if defined(__has_cpp_attribute) - #if __has_cpp_attribute(nodiscard) - #if defined(__clang__) && !defined(JSON_HAS_CPP_17) // issue #1535 - #define JSON_NODISCARD - #else - #define JSON_NODISCARD [[nodiscard]] - #endif - #elif __has_cpp_attribute(gnu::warn_unused_result) - #define JSON_NODISCARD [[gnu::warn_unused_result]] - #else - #define JSON_NODISCARD - #endif -#else - #define JSON_NODISCARD -#endif - // allow to disable exceptions #if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) #define JSON_THROW(exception) throw exception @@ -98,15 +73,6 @@ #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER #endif -// manual branch prediction -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_LIKELY(x) __builtin_expect(x, 1) - #define JSON_UNLIKELY(x) __builtin_expect(x, 0) -#else - #define JSON_LIKELY(x) x - #define JSON_UNLIKELY(x) x -#endif - /*! @brief macro to briefly define a mapping between an enum and JSON @def NLOHMANN_JSON_SERIALIZE_ENUM diff --git a/include/nlohmann/detail/macro_unscope.hpp b/include/nlohmann/detail/macro_unscope.hpp index 592debf7..8ad57a57 100644 --- a/include/nlohmann/detail/macro_unscope.hpp +++ b/include/nlohmann/detail/macro_unscope.hpp @@ -13,10 +13,6 @@ #undef JSON_CATCH #undef JSON_THROW #undef JSON_TRY -#undef JSON_LIKELY -#undef JSON_UNLIKELY -#undef JSON_DEPRECATED -#undef JSON_NODISCARD #undef JSON_HAS_CPP_14 #undef JSON_HAS_CPP_17 #undef NLOHMANN_BASIC_JSON_TPL_DECLARATION diff --git a/include/nlohmann/detail/output/binary_writer.hpp b/include/nlohmann/detail/output/binary_writer.hpp index a8fddfee..54206fd4 100644 --- a/include/nlohmann/detail/output/binary_writer.hpp +++ b/include/nlohmann/detail/output/binary_writer.hpp @@ -8,6 +8,7 @@ #include // string #include +#include #include namespace nlohmann @@ -714,7 +715,7 @@ class binary_writer static std::size_t calc_bson_entry_header_size(const string_t& name) { const auto it = name.find(static_cast(0)); - if (JSON_UNLIKELY(it != BasicJsonType::string_t::npos)) + if (HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) { JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index 699757d6..65090221 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -8,6 +8,7 @@ #include // basic_ostream #include // basic_string #include // vector +#include namespace nlohmann { @@ -39,6 +40,7 @@ class output_vector_adapter : public output_adapter_protocol v.push_back(c); } + HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { std::copy(s, s + length, std::back_inserter(v)); @@ -62,6 +64,7 @@ class output_stream_adapter : public output_adapter_protocol stream.put(c); } + HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { stream.write(s, static_cast(length)); @@ -85,6 +88,7 @@ class output_string_adapter : public output_adapter_protocol str.push_back(c); } + HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { str.append(s, length); diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index bb7f1314..d17f54d4 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -110,7 +110,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (JSON_UNLIKELY(indent_string.size() < new_indent)) + if (HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -183,7 +183,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (JSON_UNLIKELY(indent_string.size() < new_indent)) + if (HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -498,7 +498,7 @@ class serializer } // we finished processing the string - if (JSON_LIKELY(state == UTF8_ACCEPT)) + if (HEDLEY_LIKELY(state == UTF8_ACCEPT)) { // write buffer if (bytes > 0) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 58db19d7..2443f319 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -319,7 +319,7 @@ class basic_json @since 2.1.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json meta() { basic_json result; @@ -824,6 +824,7 @@ class basic_json /// helper for exception-safe object creation template + HEDLEY_RETURNS_NON_NULL static T* create(Args&& ... args) { AllocatorType alloc; @@ -950,7 +951,7 @@ class basic_json default: { object = nullptr; // silence warning, see #821 - if (JSON_UNLIKELY(t == value_t::null)) + if (HEDLEY_UNLIKELY(t == value_t::null)) { JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.6.1")); // LCOV_EXCL_LINE } @@ -1427,7 +1428,7 @@ class basic_json } // if object is wanted but impossible, throw an exception - if (JSON_UNLIKELY(manual_type == value_t::object and not is_an_object)) + if (HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) { JSON_THROW(type_error::create(301, "cannot create object from initializer list")); } @@ -1494,7 +1495,7 @@ class basic_json @since version 1.0.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json array(initializer_list_t init = {}) { return basic_json(init, false, value_t::array); @@ -1538,7 +1539,7 @@ class basic_json @since version 1.0.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json object(initializer_list_t init = {}) { return basic_json(init, false, value_t::object); @@ -1637,7 +1638,7 @@ class basic_json assert(last.m_object != nullptr); // make sure iterator fits the current value - if (JSON_UNLIKELY(first.m_object != last.m_object)) + if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); } @@ -1654,8 +1655,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (JSON_UNLIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -2368,7 +2369,7 @@ class basic_json /// get a boolean (explicit) boolean_t get_impl(boolean_t* /*unused*/) const { - if (JSON_LIKELY(is_boolean())) + if (HEDLEY_LIKELY(is_boolean())) { return m_value.boolean; } @@ -2477,7 +2478,7 @@ class basic_json // delegate the call to get_ptr<>() auto ptr = obj.template get_ptr::type>(); - if (JSON_LIKELY(ptr != nullptr)) + if (HEDLEY_LIKELY(ptr != nullptr)) { return *ptr; } @@ -2928,7 +2929,7 @@ class basic_json reference at(size_type idx) { // at only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -2975,7 +2976,7 @@ class basic_json const_reference at(size_type idx) const { // at only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -3026,7 +3027,7 @@ class basic_json reference at(const typename object_t::key_type& key) { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -3077,7 +3078,7 @@ class basic_json const_reference at(const typename object_t::key_type& key) const { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -3131,7 +3132,7 @@ class basic_json } // operator[] only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { // fill up array with null values if given idx is outside range if (idx >= m_value.array->size()) @@ -3169,7 +3170,7 @@ class basic_json const_reference operator[](size_type idx) const { // const operator[] only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { return m_value.array->operator[](idx); } @@ -3215,7 +3216,7 @@ class basic_json } // operator[] only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -3256,7 +3257,7 @@ class basic_json const_reference operator[](const typename object_t::key_type& key) const { // const operator[] only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -3293,6 +3294,7 @@ class basic_json @since version 1.1.0 */ template + HEDLEY_NON_NULL(2) reference operator[](T* key) { // implicitly convert null to object @@ -3304,7 +3306,7 @@ class basic_json } // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -3343,10 +3345,11 @@ class basic_json @since version 1.1.0 */ template + HEDLEY_NON_NULL(2) const_reference operator[](T* key) const { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -3410,7 +3413,7 @@ class basic_json ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { // if key is found, return value and given default value otherwise const auto it = find(key); @@ -3482,7 +3485,7 @@ class basic_json ValueType value(const json_pointer& ptr, const ValueType& default_value) const { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { // if pointer resolves a value, return it or use default value JSON_TRY @@ -3502,6 +3505,7 @@ class basic_json @brief overload for a default value of type const char* @copydoc basic_json::value(const json_pointer&, ValueType) const */ + HEDLEY_NON_NULL(3) string_t value(const json_pointer& ptr, const char* default_value) const { return value(ptr, string_t(default_value)); @@ -3646,7 +3650,7 @@ class basic_json IteratorType erase(IteratorType pos) { // make sure iterator fits the current value - if (JSON_UNLIKELY(this != pos.m_object)) + if (HEDLEY_UNLIKELY(this != pos.m_object)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -3661,7 +3665,7 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (JSON_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) + if (HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) { JSON_THROW(invalid_iterator::create(205, "iterator out of range")); } @@ -3751,7 +3755,7 @@ class basic_json IteratorType erase(IteratorType first, IteratorType last) { // make sure iterator fits the current value - if (JSON_UNLIKELY(this != first.m_object or this != last.m_object)) + if (HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) { JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); } @@ -3766,8 +3770,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (JSON_LIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -3838,7 +3842,7 @@ class basic_json size_type erase(const typename object_t::key_type& key) { // this erase only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { return m_value.object->erase(key); } @@ -3873,9 +3877,9 @@ class basic_json void erase(const size_type idx) { // this erase only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { - if (JSON_UNLIKELY(idx >= size())) + if (HEDLEY_UNLIKELY(idx >= size())) { JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); } @@ -4351,7 +4355,7 @@ class basic_json future 4.0.0 of the library. Please use @ref items() instead; that is, replace `json::iterator_wrapper(j)` with `j.items()`. */ - JSON_DEPRECATED + HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(reference ref) noexcept { return ref.items(); @@ -4360,7 +4364,7 @@ class basic_json /*! @copydoc iterator_wrapper(reference) */ - JSON_DEPRECATED + HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(const_reference ref) noexcept { return ref.items(); @@ -4779,7 +4783,7 @@ class basic_json void push_back(basic_json&& val) { // push_back only works for null objects or arrays - if (JSON_UNLIKELY(not(is_null() or is_array()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4816,7 +4820,7 @@ class basic_json void push_back(const basic_json& val) { // push_back only works for null objects or arrays - if (JSON_UNLIKELY(not(is_null() or is_array()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4866,7 +4870,7 @@ class basic_json void push_back(const typename object_t::value_type& val) { // push_back only works for null objects or objects - if (JSON_UNLIKELY(not(is_null() or is_object()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4967,7 +4971,7 @@ class basic_json void emplace_back(Args&& ... args) { // emplace_back only works for null objects or arrays - if (JSON_UNLIKELY(not(is_null() or is_array()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); } @@ -5015,7 +5019,7 @@ class basic_json std::pair emplace(Args&& ... args) { // emplace only works for null objects or arrays - if (JSON_UNLIKELY(not(is_null() or is_object()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); } @@ -5083,10 +5087,10 @@ class basic_json iterator insert(const_iterator pos, const basic_json& val) { // insert only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (JSON_UNLIKELY(pos.m_object != this)) + if (HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5134,10 +5138,10 @@ class basic_json iterator insert(const_iterator pos, size_type cnt, const basic_json& val) { // insert only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (JSON_UNLIKELY(pos.m_object != this)) + if (HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5182,24 +5186,24 @@ class basic_json iterator insert(const_iterator pos, const_iterator first, const_iterator last) { // insert only works for arrays - if (JSON_UNLIKELY(not is_array())) + if (HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (JSON_UNLIKELY(pos.m_object != this)) + if (HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } // check if range iterators belong to the same JSON object - if (JSON_UNLIKELY(first.m_object != last.m_object)) + if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } - if (JSON_UNLIKELY(first.m_object == this)) + if (HEDLEY_UNLIKELY(first.m_object == this)) { JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); } @@ -5235,13 +5239,13 @@ class basic_json iterator insert(const_iterator pos, initializer_list_t ilist) { // insert only works for arrays - if (JSON_UNLIKELY(not is_array())) + if (HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (JSON_UNLIKELY(pos.m_object != this)) + if (HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5276,19 +5280,19 @@ class basic_json void insert(const_iterator first, const_iterator last) { // insert only works for objects - if (JSON_UNLIKELY(not is_object())) + if (HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (JSON_UNLIKELY(first.m_object != last.m_object)) + if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (JSON_UNLIKELY(not first.m_object->is_object())) + if (HEDLEY_UNLIKELY(not first.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -5325,11 +5329,11 @@ class basic_json assert_invariant(); } - if (JSON_UNLIKELY(not is_object())) + if (HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } - if (JSON_UNLIKELY(not j.is_object())) + if (HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); } @@ -5376,20 +5380,20 @@ class basic_json assert_invariant(); } - if (JSON_UNLIKELY(not is_object())) + if (HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (JSON_UNLIKELY(first.m_object != last.m_object)) + if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (JSON_UNLIKELY(not first.m_object->is_object() - or not last.m_object->is_object())) + if (HEDLEY_UNLIKELY(not first.m_object->is_object() + or not last.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -5452,7 +5456,7 @@ class basic_json void swap(array_t& other) { // swap only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { std::swap(*(m_value.array), other); } @@ -5485,7 +5489,7 @@ class basic_json void swap(object_t& other) { // swap only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { std::swap(*(m_value.object), other); } @@ -5518,7 +5522,7 @@ class basic_json void swap(string_t& other) { // swap only works for strings - if (JSON_LIKELY(is_string())) + if (HEDLEY_LIKELY(is_string())) { std::swap(*(m_value.string), other); } @@ -6028,7 +6032,7 @@ class basic_json instead; that is, replace calls like `j >> o;` with `o << j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - JSON_DEPRECATED + HEDLEY_DEPRECATED(3.0.0) friend std::ostream& operator>>(const basic_json& j, std::ostream& o) { return o << j; @@ -6107,7 +6111,7 @@ class basic_json @since version 2.0.3 (contiguous containers) */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json parse(detail::input_adapter&& i, const parser_callback_t cb = nullptr, const bool allow_exceptions = true) @@ -6176,6 +6180,7 @@ class basic_json @since version 3.2.0 */ template + HEDLEY_NON_NULL(2) static bool sax_parse(detail::input_adapter&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true) @@ -6261,6 +6266,7 @@ class basic_json std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits::iterator_category>::value, int>::type = 0> + HEDLEY_NON_NULL(3) static bool sax_parse(IteratorType first, IteratorType last, SAX* sax) { return parser(detail::input_adapter(first, last)).sax_parse(sax); @@ -6274,7 +6280,7 @@ class basic_json instead; that is, replace calls like `j << i;` with `i >> j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - JSON_DEPRECATED + HEDLEY_DEPRECATED(3.0.0) friend std::istream& operator<<(basic_json& j, std::istream& i) { return operator>>(i, j); @@ -6347,6 +6353,7 @@ class basic_json @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` since 3.0.0 */ + HEDLEY_RETURNS_NON_NULL const char* type_name() const noexcept { { @@ -6876,7 +6883,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -6892,7 +6899,7 @@ class basic_json */ template::value, int> = 0> - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -6985,7 +6992,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7001,7 +7008,7 @@ class basic_json */ template::value, int> = 0> - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7073,7 +7080,7 @@ class basic_json @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7089,7 +7096,7 @@ class basic_json */ template::value, int> = 0> - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7160,7 +7167,7 @@ class basic_json @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the related UBJSON format */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7176,7 +7183,7 @@ class basic_json */ template::value, int> = 0> - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7550,7 +7557,7 @@ class basic_json else { const auto idx = json_pointer::array_index(last_path); - if (JSON_UNLIKELY(static_cast(idx) > parent.size())) + if (HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) { // avoid undefined behavior JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); @@ -7581,7 +7588,7 @@ class basic_json { // perform range check auto it = parent.find(last_path); - if (JSON_LIKELY(it != parent.end())) + if (HEDLEY_LIKELY(it != parent.end())) { parent.erase(it); } @@ -7598,7 +7605,7 @@ class basic_json }; // type check: top level value must be an array - if (JSON_UNLIKELY(not json_patch.is_array())) + if (HEDLEY_UNLIKELY(not json_patch.is_array())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -7618,13 +7625,13 @@ class basic_json const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; // check if desired value is present - if (JSON_UNLIKELY(it == val.m_value.object->end())) + if (HEDLEY_UNLIKELY(it == val.m_value.object->end())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); } // check if result is of type string - if (JSON_UNLIKELY(string_type and not it->second.is_string())) + if (HEDLEY_UNLIKELY(string_type and not it->second.is_string())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); } @@ -7634,7 +7641,7 @@ class basic_json }; // type check: every element of the array must be an object - if (JSON_UNLIKELY(not val.is_object())) + if (HEDLEY_UNLIKELY(not val.is_object())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -7712,7 +7719,7 @@ class basic_json } // throw an exception if test fails - if (JSON_UNLIKELY(not success)) + if (HEDLEY_UNLIKELY(not success)) { JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); } @@ -7765,7 +7772,7 @@ class basic_json @since version 2.0.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json diff(const basic_json& source, const basic_json& target, const std::string& path = "") { @@ -8057,6 +8064,7 @@ if no parse error occurred. @since version 1.0.0 */ +HEDLEY_NON_NULL(1) inline nlohmann::json operator "" _json(const char* s, std::size_t n) { return nlohmann::json::parse(s, s + n); @@ -8075,6 +8083,7 @@ object if no parse error occurred. @since version 2.0.0 */ +HEDLEY_NON_NULL(1) inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) { return nlohmann::json::json_pointer(std::string(s, n)); diff --git a/include/nlohmann/thirdparty/hedley/hedley.hpp b/include/nlohmann/thirdparty/hedley/hedley.hpp new file mode 100644 index 00000000..eb4c2018 --- /dev/null +++ b/include/nlohmann/thirdparty/hedley/hedley.hpp @@ -0,0 +1,1505 @@ +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + * + * To the extent possible under law, the author(s) have dedicated all + * copyright and related and neighboring rights to this software to + * the public domain worldwide. This software is distributed without + * any warranty. + * + * For details, see . + * SPDX-License-Identifier: CC0-1.0 + */ + +#if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 9) +#if defined(HEDLEY_VERSION) + #undef HEDLEY_VERSION +#endif +#define HEDLEY_VERSION 9 + +#if defined(HEDLEY_STRINGIFY_EX) + #undef HEDLEY_STRINGIFY_EX +#endif +#define HEDLEY_STRINGIFY_EX(x) #x + +#if defined(HEDLEY_STRINGIFY) + #undef HEDLEY_STRINGIFY +#endif +#define HEDLEY_STRINGIFY(x) HEDLEY_STRINGIFY_EX(x) + +#if defined(HEDLEY_CONCAT_EX) + #undef HEDLEY_CONCAT_EX +#endif +#define HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(HEDLEY_CONCAT) + #undef HEDLEY_CONCAT +#endif +#define HEDLEY_CONCAT(a,b) HEDLEY_CONCAT_EX(a,b) + +#if defined(HEDLEY_VERSION_ENCODE) + #undef HEDLEY_VERSION_ENCODE +#endif +#define HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(HEDLEY_VERSION_DECODE_MAJOR) + #undef HEDLEY_VERSION_DECODE_MAJOR +#endif +#define HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(HEDLEY_VERSION_DECODE_MINOR) + #undef HEDLEY_VERSION_DECODE_MINOR +#endif +#define HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(HEDLEY_VERSION_DECODE_REVISION) + #undef HEDLEY_VERSION_DECODE_REVISION +#endif +#define HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(HEDLEY_GNUC_VERSION) + #undef HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(HEDLEY_GNUC_VERSION_CHECK) + #undef HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(HEDLEY_GNUC_VERSION) + #define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (HEDLEY_GNUC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_MSVC_VERSION) + #undef HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) + #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) + #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) + #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(HEDLEY_MSVC_VERSION_CHECK) + #undef HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(_MSC_VER) + #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(HEDLEY_INTEL_VERSION) + #undef HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) + #define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) + #define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(HEDLEY_INTEL_VERSION_CHECK) + #undef HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(HEDLEY_INTEL_VERSION) + #define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (HEDLEY_INTEL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_PGI_VERSION) + #undef HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define HEDLEY_PGI_VERSION HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(HEDLEY_PGI_VERSION_CHECK) + #undef HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(HEDLEY_PGI_VERSION) + #define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (HEDLEY_PGI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_SUNPRO_VERSION) + #undef HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(HEDLEY_SUNPRO_VERSION_CHECK) + #undef HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(HEDLEY_SUNPRO_VERSION) + #define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (HEDLEY_SUNPRO_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_EMSCRIPTEN_VERSION) + #undef HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(HEDLEY_EMSCRIPTEN_VERSION) + #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (HEDLEY_EMSCRIPTEN_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_ARM_VERSION) + #undef HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(HEDLEY_ARM_VERSION_CHECK) + #undef HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(HEDLEY_ARM_VERSION) + #define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (HEDLEY_ARM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_IBM_VERSION) + #undef HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(HEDLEY_IBM_VERSION_CHECK) + #undef HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(HEDLEY_IBM_VERSION) + #define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (HEDLEY_IBM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_TI_VERSION) + #undef HEDLEY_TI_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) + #define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(HEDLEY_TI_VERSION_CHECK) + #undef HEDLEY_TI_VERSION_CHECK +#endif +#if defined(HEDLEY_TI_VERSION) + #define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_CRAY_VERSION) + #undef HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(HEDLEY_CRAY_VERSION_CHECK) + #undef HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(HEDLEY_CRAY_VERSION) + #define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (HEDLEY_CRAY_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_IAR_VERSION) + #undef HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(HEDLEY_IAR_VERSION_CHECK) + #undef HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(HEDLEY_IAR_VERSION) + #define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (HEDLEY_IAR_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_TINYC_VERSION) + #undef HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define HEDLEY_TINYC_VERSION HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(HEDLEY_TINYC_VERSION_CHECK) + #undef HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(HEDLEY_TINYC_VERSION) + #define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (HEDLEY_TINYC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_DMC_VERSION) + #undef HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define HEDLEY_DMC_VERSION HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(HEDLEY_DMC_VERSION_CHECK) + #undef HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(HEDLEY_DMC_VERSION) + #define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (HEDLEY_DMC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_COMPCERT_VERSION) + #undef HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define HEDLEY_COMPCERT_VERSION HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(HEDLEY_COMPCERT_VERSION_CHECK) + #undef HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(HEDLEY_COMPCERT_VERSION) + #define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (HEDLEY_COMPCERT_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_PELLES_VERSION) + #undef HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define HEDLEY_PELLES_VERSION HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(HEDLEY_PELLES_VERSION_CHECK) + #undef HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(HEDLEY_PELLES_VERSION) + #define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (HEDLEY_PELLES_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_GCC_VERSION) + #undef HEDLEY_GCC_VERSION +#endif +#if \ + defined(HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(HEDLEY_INTEL_VERSION) && \ + !defined(HEDLEY_PGI_VERSION) && \ + !defined(HEDLEY_ARM_VERSION) && \ + !defined(HEDLEY_TI_VERSION) && \ + !defined(__COMPCERT__) + #define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION +#endif + +#if defined(HEDLEY_GCC_VERSION_CHECK) + #undef HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(HEDLEY_GCC_VERSION) + #define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (HEDLEY_GCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_HAS_ATTRIBUTE) + #undef HEDLEY_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else + #define HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_ATTRIBUTE) + #undef HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_CPP_ATTRIBUTE) + #undef HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_BUILTIN) + #undef HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_BUILTIN) + #undef HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_BUILTIN) + #undef HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_FEATURE) + #undef HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_FEATURE) + #undef HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_FEATURE) + #undef HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_EXTENSION) + #undef HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_EXTENSION) + #undef HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_EXTENSION) + #undef HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_WARNING) + #undef HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_WARNING) + #undef HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_WARNING) + #undef HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,0,0) || \ + HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define HEDLEY_PRAGMA(value) _Pragma(#value) +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define HEDLEY_PRAGMA(value) __pragma(value) +#else + #define HEDLEY_PRAGMA(value) +#endif + +#if defined(HEDLEY_DIAGNOSTIC_PUSH) + #undef HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(HEDLEY_DIAGNOSTIC_POP) + #undef HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif HEDLEY_TI_VERSION_CHECK(8,1,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define HEDLEY_DIAGNOSTIC_PUSH + #define HEDLEY_DIAGNOSTIC_POP +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif HEDLEY_TI_VERSION_CHECK(8,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif HEDLEY_TI_VERSION_CHECK(8,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#else + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if HEDLEY_HAS_WARNING("-Wcast-qual") + #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(HEDLEY_DEPRECATED) + #undef HEDLEY_DEPRECATED +#endif +#if defined(HEDLEY_DEPRECATED_FOR) + #undef HEDLEY_DEPRECATED_FOR +#endif +#if defined(__cplusplus) && (__cplusplus >= 201402L) + #define HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] + #define HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] +#elif \ + HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + HEDLEY_TI_VERSION_CHECK(8,3,0) + #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif \ + HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define HEDLEY_DEPRECATED(since) _declspec(deprecated) + #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define HEDLEY_DEPRECATED(since) + #define HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(HEDLEY_UNAVAILABLE) + #undef HEDLEY_UNAVAILABLE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(warning) || \ + HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(HEDLEY_WARN_UNUSED_RESULT) + #undef HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(__cplusplus) && (__cplusplus >= 201703L) + #define HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] +#elif \ + HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) +#elif defined(_Check_return_) /* SAL */ + #define HEDLEY_WARN_UNUSED_RESULT _Check_return_ +#else + #define HEDLEY_WARN_UNUSED_RESULT +#endif + +#if defined(HEDLEY_SENTINEL) + #undef HEDLEY_SENTINEL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define HEDLEY_SENTINEL(position) +#endif + +#if defined(HEDLEY_NO_RETURN) + #undef HEDLEY_NO_RETURN +#endif +#if HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_NO_RETURN __noreturn +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define HEDLEY_NO_RETURN [[noreturn]] +#elif \ + HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(18,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define HEDLEY_NO_RETURN __declspec(noreturn) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define HEDLEY_NO_RETURN __attribute((noreturn)) +#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define HEDLEY_NO_RETURN +#endif + +#if defined(HEDLEY_UNREACHABLE) + #undef HEDLEY_UNREACHABLE +#endif +#if defined(HEDLEY_UNREACHABLE_RETURN) + #undef HEDLEY_UNREACHABLE_RETURN +#endif +#if \ + (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define HEDLEY_UNREACHABLE() __assume(0) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) + #if defined(__cplusplus) + #define HEDLEY_UNREACHABLE() std::_nassert(0) + #else + #define HEDLEY_UNREACHABLE() _nassert(0) + #endif + #define HEDLEY_UNREACHABLE_RETURN(value) return value +#elif defined(EXIT_FAILURE) + #define HEDLEY_UNREACHABLE() abort() +#else + #define HEDLEY_UNREACHABLE() + #define HEDLEY_UNREACHABLE_RETURN(value) return value +#endif +#if !defined(HEDLEY_UNREACHABLE_RETURN) + #define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE() +#endif + +#if defined(HEDLEY_ASSUME) + #undef HEDLEY_ASSUME +#endif +#if \ + HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_ASSUME(expr) __assume(expr) +#elif HEDLEY_HAS_BUILTIN(__builtin_assume) + #define HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) + #if defined(__cplusplus) + #define HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#elif \ + (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(HEDLEY_ARM_VERSION)) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) +#else + #define HEDLEY_ASSUME(expr) ((void) (expr)) +#endif + + +HEDLEY_DIAGNOSTIC_PUSH +#if \ + HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(HEDLEY_NON_NULL) + #undef HEDLEY_NON_NULL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define HEDLEY_NON_NULL(...) +#endif +HEDLEY_DIAGNOSTIC_POP + +#if defined(HEDLEY_PRINTF_FORMAT) + #undef HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + HEDLEY_HAS_ATTRIBUTE(format) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(HEDLEY_CONSTEXPR) + #undef HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define HEDLEY_CONSTEXPR constexpr + #endif +#endif +#if !defined(HEDLEY_CONSTEXPR) + #define HEDLEY_CONSTEXPR +#endif + +#if defined(HEDLEY_PREDICT) + #undef HEDLEY_PREDICT +#endif +#if defined(HEDLEY_LIKELY) + #undef HEDLEY_LIKELY +#endif +#if defined(HEDLEY_UNLIKELY) + #undef HEDLEY_UNLIKELY +#endif +#if defined(HEDLEY_UNPREDICTABLE) + #undef HEDLEY_UNPREDICTABLE +#endif +#if HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) +#endif +#if \ + HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) +# define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) +# define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) +# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#if !defined(HEDLEY_BUILTIN_UNPREDICTABLE) + #define HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) +#endif +#elif \ + HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,27) +# define HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void) (expected)), !!(expr))) +# define HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) +# define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define HEDLEY_LIKELY(expr) (!!(expr)) +# define HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(HEDLEY_UNPREDICTABLE) + #define HEDLEY_UNPREDICTABLE(expr) HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(HEDLEY_MALLOC) + #undef HEDLEY_MALLOC +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(malloc) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_MALLOC __attribute__((__malloc__)) +#elif HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define HEDLEY_MALLOC __declspec(restrict) +#else + #define HEDLEY_MALLOC +#endif + +#if defined(HEDLEY_PURE) + #undef HEDLEY_PURE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(pure) || \ + HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_PURE __attribute__((__pure__)) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else + #define HEDLEY_PURE +#endif + +#if defined(HEDLEY_CONST) + #undef HEDLEY_CONST +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(const) || \ + HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_CONST __attribute__((__const__)) +#else + #define HEDLEY_CONST HEDLEY_PURE +#endif + +#if defined(HEDLEY_RESTRICT) + #undef HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define HEDLEY_RESTRICT restrict +#elif \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) + #define HEDLEY_RESTRICT __restrict +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define HEDLEY_RESTRICT _Restrict +#else + #define HEDLEY_RESTRICT +#endif + +#if defined(HEDLEY_INLINE) + #undef HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define HEDLEY_INLINE inline +#elif \ + defined(HEDLEY_GCC_VERSION) || \ + HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define HEDLEY_INLINE __inline__ +#elif \ + HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) + #define HEDLEY_INLINE __inline +#else + #define HEDLEY_INLINE +#endif + +#if defined(HEDLEY_ALWAYS_INLINE) + #undef HEDLEY_ALWAYS_INLINE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE +#elif HEDLEY_MSVC_VERSION_CHECK(12,0,0) + #define HEDLEY_ALWAYS_INLINE __forceinline +#elif HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) + #define HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else + #define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE +#endif + +#if defined(HEDLEY_NEVER_INLINE) + #undef HEDLEY_NEVER_INLINE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(noinline) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define HEDLEY_NEVER_INLINE __declspec(noinline) +#elif HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define HEDLEY_NEVER_INLINE +#endif + +#if defined(HEDLEY_PRIVATE) + #undef HEDLEY_PRIVATE +#endif +#if defined(HEDLEY_PUBLIC) + #undef HEDLEY_PUBLIC +#endif +#if defined(HEDLEY_IMPORT) + #undef HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) + #define HEDLEY_PRIVATE + #define HEDLEY_PUBLIC __declspec(dllexport) + #define HEDLEY_IMPORT __declspec(dllimport) +#else + #if \ + HEDLEY_HAS_ATTRIBUTE(visibility) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) + #define HEDLEY_PUBLIC __attribute__((__visibility__("default"))) + #else + #define HEDLEY_PRIVATE + #define HEDLEY_PUBLIC + #endif + #define HEDLEY_IMPORT extern +#endif + +#if defined(HEDLEY_NO_THROW) + #undef HEDLEY_NO_THROW +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define HEDLEY_NO_THROW __declspec(nothrow) +#else + #define HEDLEY_NO_THROW +#endif + +#if defined(HEDLEY_FALL_THROUGH) + #undef HEDLEY_FALL_THROUGH +#endif +#if \ + defined(__cplusplus) && \ + (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + !defined(HEDLEY_PGI_VERSION) + #if \ + (__cplusplus >= 201703L) || \ + ((__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) + #define HEDLEY_FALL_THROUGH [[fallthrough]] + #elif (__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) + #define HEDLEY_FALL_THROUGH [[clang::fallthrough]] + #elif (__cplusplus >= 201103L) && HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define HEDLEY_FALL_THROUGH [[gnu::fallthrough]] + #endif +#endif +#if !defined(HEDLEY_FALL_THROUGH) + #if HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(HEDLEY_PGI_VERSION) + #define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) + #elif defined(__fallthrough) /* SAL */ + #define HEDLEY_FALL_THROUGH __fallthrough + #else + #define HEDLEY_FALL_THROUGH + #endif +#endif + +#if defined(HEDLEY_RETURNS_NON_NULL) + #undef HEDLEY_RETURNS_NON_NULL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(HEDLEY_ARRAY_PARAM) + #undef HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(HEDLEY_PGI_VERSION) && \ + !defined(HEDLEY_TINYC_VERSION) + #define HEDLEY_ARRAY_PARAM(name) (name) +#else + #define HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(HEDLEY_IS_CONSTANT) + #undef HEDLEY_IS_CONSTANT +#endif +#if defined(HEDLEY_REQUIRE_CONSTEXPR) + #undef HEDLEY_REQUIRE_CONSTEXPR +#endif +/* Note the double-underscore. For internal use only; no API + * guarantees! */ +#if defined(HEDLEY__IS_CONSTEXPR) + #undef HEDLEY__IS_CONSTEXPR +#endif + +#if \ + HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ + HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(HEDLEY_SUNPRO_VERSION) && !defined(HEDLEY_PGI_VERSION)) || \ + HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(HEDLEY_GCC_VERSION) || \ + defined(HEDLEY_INTEL_VERSION) || \ + defined(HEDLEY_TINYC_VERSION) || \ + defined(HEDLEY_TI_VERSION) || \ + defined(__clang__) +# define HEDLEY__IS_CONSTEXPR(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(HEDLEY__IS_CONSTEXPR) + #if !defined(HEDLEY_IS_CONSTANT) + #define HEDLEY_IS_CONSTANT(expr) HEDLEY__IS_CONSTEXPR(expr) + #endif + #define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) +#else + #if !defined(HEDLEY_IS_CONSTANT) + #define HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(HEDLEY_BEGIN_C_DECLS) + #undef HEDLEY_BEGIN_C_DECLS +#endif +#if defined(HEDLEY_END_C_DECLS) + #undef HEDLEY_END_C_DECLS +#endif +#if defined(HEDLEY_C_DECL) + #undef HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define HEDLEY_BEGIN_C_DECLS extern "C" { + #define HEDLEY_END_C_DECLS } + #define HEDLEY_C_DECL extern "C" +#else + #define HEDLEY_BEGIN_C_DECLS + #define HEDLEY_END_C_DECLS + #define HEDLEY_C_DECL +#endif + +#if defined(HEDLEY_STATIC_ASSERT) + #undef HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + HEDLEY_HAS_FEATURE(c_static_assert) || \ + HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ + HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + (defined(__cplusplus) && HEDLEY_TI_VERSION_CHECK(8,3,0)) +# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) +#elif defined(__cplusplus) && (__cplusplus >= 201103L) +# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) +#else +# define HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(HEDLEY_CONST_CAST) + #undef HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + HEDLEY_HAS_WARNING("-Wcast-qual") || \ + HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(HEDLEY_REINTERPRET_CAST) + #undef HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) +#endif + +#if defined(HEDLEY_STATIC_CAST) + #undef HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(HEDLEY_CPP_CAST) + #undef HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) + #define HEDLEY_CPP_CAST(T, expr) static_cast(expr) +#else + #define HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(HEDLEY_MESSAGE) + #undef HEDLEY_MESSAGE +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define HEDLEY_MESSAGE(msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + HEDLEY_PRAGMA(message msg) \ + HEDLEY_DIAGNOSTIC_POP +#elif \ + HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message msg) +#elif HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(_CRI message msg) +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) +#elif HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) +#else +# define HEDLEY_MESSAGE(msg) +#endif + +#if defined(HEDLEY_WARNING) + #undef HEDLEY_WARNING +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define HEDLEY_WARNING(msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + HEDLEY_PRAGMA(clang warning msg) \ + HEDLEY_DIAGNOSTIC_POP +#elif \ + HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + HEDLEY_PGI_VERSION_CHECK(18,4,0) +# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg) +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg)) +#else +# define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg) +#endif + +#if defined(HEDLEY_REQUIRE_MSG) + #undef HEDLEY_REQUIRE_MSG +#endif +#if HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if HEDLEY_HAS_WARNING("-Wgcc-compat") +# define HEDLEY_REQUIRE_MSG(expr, msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((__diagnose_if__(!(expr), msg, "error"))) \ + HEDLEY_DIAGNOSTIC_POP +# else +# define HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) +# endif +#else +# define HEDLEY_REQUIRE_MSG(expr, msg) +#endif + +#if defined(HEDLEY_REQUIRE) + #undef HEDLEY_REQUIRE +#endif +#define HEDLEY_REQUIRE(expr) HEDLEY_REQUIRE_MSG(expr, #expr) + +#if defined(HEDLEY_FLAGS) + #undef HEDLEY_FLAGS +#endif +#if HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define HEDLEY_FLAGS __attribute__((__flag_enum__)) +#endif + +#if defined(HEDLEY_FLAGS_CAST) + #undef HEDLEY_FLAGS_CAST +#endif +#if HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define HEDLEY_FLAGS_CAST(T, expr) HEDLEY_STATIC_CAST(T, expr) +#endif + +/* Remaining macros are deprecated. */ + +#if defined(HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_BUILTIN) + #undef HEDLEY_CLANG_HAS_BUILTIN +#endif +#define HEDLEY_CLANG_HAS_BUILTIN(builtin) HEDLEY_HAS_BUILTIN(builtin) + +#if defined(HEDLEY_CLANG_HAS_FEATURE) + #undef HEDLEY_CLANG_HAS_FEATURE +#endif +#define HEDLEY_CLANG_HAS_FEATURE(feature) HEDLEY_HAS_FEATURE(feature) + +#if defined(HEDLEY_CLANG_HAS_EXTENSION) + #undef HEDLEY_CLANG_HAS_EXTENSION +#endif +#define HEDLEY_CLANG_HAS_EXTENSION(extension) HEDLEY_HAS_EXTENSION(extension) + +#if defined(HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_WARNING) + #undef HEDLEY_CLANG_HAS_WARNING +#endif +#define HEDLEY_CLANG_HAS_WARNING(warning) HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */ diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 08c4fc64..32ce6dff 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -105,6 +105,1635 @@ struct position_t } // namespace detail } // namespace nlohmann +// #include + + +#include // pair +// #include +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + * + * To the extent possible under law, the author(s) have dedicated all + * copyright and related and neighboring rights to this software to + * the public domain worldwide. This software is distributed without + * any warranty. + * + * For details, see . + * SPDX-License-Identifier: CC0-1.0 + */ + +#if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 9) +#if defined(HEDLEY_VERSION) + #undef HEDLEY_VERSION +#endif +#define HEDLEY_VERSION 9 + +#if defined(HEDLEY_STRINGIFY_EX) + #undef HEDLEY_STRINGIFY_EX +#endif +#define HEDLEY_STRINGIFY_EX(x) #x + +#if defined(HEDLEY_STRINGIFY) + #undef HEDLEY_STRINGIFY +#endif +#define HEDLEY_STRINGIFY(x) HEDLEY_STRINGIFY_EX(x) + +#if defined(HEDLEY_CONCAT_EX) + #undef HEDLEY_CONCAT_EX +#endif +#define HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(HEDLEY_CONCAT) + #undef HEDLEY_CONCAT +#endif +#define HEDLEY_CONCAT(a,b) HEDLEY_CONCAT_EX(a,b) + +#if defined(HEDLEY_VERSION_ENCODE) + #undef HEDLEY_VERSION_ENCODE +#endif +#define HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(HEDLEY_VERSION_DECODE_MAJOR) + #undef HEDLEY_VERSION_DECODE_MAJOR +#endif +#define HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(HEDLEY_VERSION_DECODE_MINOR) + #undef HEDLEY_VERSION_DECODE_MINOR +#endif +#define HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(HEDLEY_VERSION_DECODE_REVISION) + #undef HEDLEY_VERSION_DECODE_REVISION +#endif +#define HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(HEDLEY_GNUC_VERSION) + #undef HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(HEDLEY_GNUC_VERSION_CHECK) + #undef HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(HEDLEY_GNUC_VERSION) + #define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (HEDLEY_GNUC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_MSVC_VERSION) + #undef HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) + #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) + #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) + #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(HEDLEY_MSVC_VERSION_CHECK) + #undef HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(_MSC_VER) + #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(HEDLEY_INTEL_VERSION) + #undef HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) + #define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) + #define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(HEDLEY_INTEL_VERSION_CHECK) + #undef HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(HEDLEY_INTEL_VERSION) + #define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (HEDLEY_INTEL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_PGI_VERSION) + #undef HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define HEDLEY_PGI_VERSION HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(HEDLEY_PGI_VERSION_CHECK) + #undef HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(HEDLEY_PGI_VERSION) + #define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (HEDLEY_PGI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_SUNPRO_VERSION) + #undef HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(HEDLEY_SUNPRO_VERSION_CHECK) + #undef HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(HEDLEY_SUNPRO_VERSION) + #define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (HEDLEY_SUNPRO_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_EMSCRIPTEN_VERSION) + #undef HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(HEDLEY_EMSCRIPTEN_VERSION) + #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (HEDLEY_EMSCRIPTEN_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_ARM_VERSION) + #undef HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(HEDLEY_ARM_VERSION_CHECK) + #undef HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(HEDLEY_ARM_VERSION) + #define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (HEDLEY_ARM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_IBM_VERSION) + #undef HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(HEDLEY_IBM_VERSION_CHECK) + #undef HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(HEDLEY_IBM_VERSION) + #define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (HEDLEY_IBM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_TI_VERSION) + #undef HEDLEY_TI_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) + #define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(HEDLEY_TI_VERSION_CHECK) + #undef HEDLEY_TI_VERSION_CHECK +#endif +#if defined(HEDLEY_TI_VERSION) + #define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_CRAY_VERSION) + #undef HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(HEDLEY_CRAY_VERSION_CHECK) + #undef HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(HEDLEY_CRAY_VERSION) + #define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (HEDLEY_CRAY_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_IAR_VERSION) + #undef HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(HEDLEY_IAR_VERSION_CHECK) + #undef HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(HEDLEY_IAR_VERSION) + #define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (HEDLEY_IAR_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_TINYC_VERSION) + #undef HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define HEDLEY_TINYC_VERSION HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(HEDLEY_TINYC_VERSION_CHECK) + #undef HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(HEDLEY_TINYC_VERSION) + #define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (HEDLEY_TINYC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_DMC_VERSION) + #undef HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define HEDLEY_DMC_VERSION HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(HEDLEY_DMC_VERSION_CHECK) + #undef HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(HEDLEY_DMC_VERSION) + #define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (HEDLEY_DMC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_COMPCERT_VERSION) + #undef HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define HEDLEY_COMPCERT_VERSION HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(HEDLEY_COMPCERT_VERSION_CHECK) + #undef HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(HEDLEY_COMPCERT_VERSION) + #define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (HEDLEY_COMPCERT_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_PELLES_VERSION) + #undef HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define HEDLEY_PELLES_VERSION HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(HEDLEY_PELLES_VERSION_CHECK) + #undef HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(HEDLEY_PELLES_VERSION) + #define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (HEDLEY_PELLES_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_GCC_VERSION) + #undef HEDLEY_GCC_VERSION +#endif +#if \ + defined(HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(HEDLEY_INTEL_VERSION) && \ + !defined(HEDLEY_PGI_VERSION) && \ + !defined(HEDLEY_ARM_VERSION) && \ + !defined(HEDLEY_TI_VERSION) && \ + !defined(__COMPCERT__) + #define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION +#endif + +#if defined(HEDLEY_GCC_VERSION_CHECK) + #undef HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(HEDLEY_GCC_VERSION) + #define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (HEDLEY_GCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_HAS_ATTRIBUTE) + #undef HEDLEY_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else + #define HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_ATTRIBUTE) + #undef HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_CPP_ATTRIBUTE) + #undef HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_BUILTIN) + #undef HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_BUILTIN) + #undef HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_BUILTIN) + #undef HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_FEATURE) + #undef HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_FEATURE) + #undef HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_FEATURE) + #undef HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_EXTENSION) + #undef HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_EXTENSION) + #undef HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_EXTENSION) + #undef HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_WARNING) + #undef HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_WARNING) + #undef HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_WARNING) + #undef HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,0,0) || \ + HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define HEDLEY_PRAGMA(value) _Pragma(#value) +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define HEDLEY_PRAGMA(value) __pragma(value) +#else + #define HEDLEY_PRAGMA(value) +#endif + +#if defined(HEDLEY_DIAGNOSTIC_PUSH) + #undef HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(HEDLEY_DIAGNOSTIC_POP) + #undef HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif HEDLEY_TI_VERSION_CHECK(8,1,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define HEDLEY_DIAGNOSTIC_PUSH + #define HEDLEY_DIAGNOSTIC_POP +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif HEDLEY_TI_VERSION_CHECK(8,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif HEDLEY_TI_VERSION_CHECK(8,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#else + #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if HEDLEY_HAS_WARNING("-Wcast-qual") + #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(HEDLEY_DEPRECATED) + #undef HEDLEY_DEPRECATED +#endif +#if defined(HEDLEY_DEPRECATED_FOR) + #undef HEDLEY_DEPRECATED_FOR +#endif +#if defined(__cplusplus) && (__cplusplus >= 201402L) + #define HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] + #define HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] +#elif \ + HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + HEDLEY_TI_VERSION_CHECK(8,3,0) + #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif \ + HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define HEDLEY_DEPRECATED(since) _declspec(deprecated) + #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define HEDLEY_DEPRECATED(since) + #define HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(HEDLEY_UNAVAILABLE) + #undef HEDLEY_UNAVAILABLE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(warning) || \ + HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(HEDLEY_WARN_UNUSED_RESULT) + #undef HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(__cplusplus) && (__cplusplus >= 201703L) + #define HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] +#elif \ + HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) +#elif defined(_Check_return_) /* SAL */ + #define HEDLEY_WARN_UNUSED_RESULT _Check_return_ +#else + #define HEDLEY_WARN_UNUSED_RESULT +#endif + +#if defined(HEDLEY_SENTINEL) + #undef HEDLEY_SENTINEL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define HEDLEY_SENTINEL(position) +#endif + +#if defined(HEDLEY_NO_RETURN) + #undef HEDLEY_NO_RETURN +#endif +#if HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_NO_RETURN __noreturn +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define HEDLEY_NO_RETURN [[noreturn]] +#elif \ + HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(18,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define HEDLEY_NO_RETURN __declspec(noreturn) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define HEDLEY_NO_RETURN __attribute((noreturn)) +#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define HEDLEY_NO_RETURN +#endif + +#if defined(HEDLEY_UNREACHABLE) + #undef HEDLEY_UNREACHABLE +#endif +#if defined(HEDLEY_UNREACHABLE_RETURN) + #undef HEDLEY_UNREACHABLE_RETURN +#endif +#if \ + (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define HEDLEY_UNREACHABLE() __assume(0) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) + #if defined(__cplusplus) + #define HEDLEY_UNREACHABLE() std::_nassert(0) + #else + #define HEDLEY_UNREACHABLE() _nassert(0) + #endif + #define HEDLEY_UNREACHABLE_RETURN(value) return value +#elif defined(EXIT_FAILURE) + #define HEDLEY_UNREACHABLE() abort() +#else + #define HEDLEY_UNREACHABLE() + #define HEDLEY_UNREACHABLE_RETURN(value) return value +#endif +#if !defined(HEDLEY_UNREACHABLE_RETURN) + #define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE() +#endif + +#if defined(HEDLEY_ASSUME) + #undef HEDLEY_ASSUME +#endif +#if \ + HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_ASSUME(expr) __assume(expr) +#elif HEDLEY_HAS_BUILTIN(__builtin_assume) + #define HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) + #if defined(__cplusplus) + #define HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#elif \ + (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(HEDLEY_ARM_VERSION)) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) +#else + #define HEDLEY_ASSUME(expr) ((void) (expr)) +#endif + + +HEDLEY_DIAGNOSTIC_PUSH +#if \ + HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(HEDLEY_NON_NULL) + #undef HEDLEY_NON_NULL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define HEDLEY_NON_NULL(...) +#endif +HEDLEY_DIAGNOSTIC_POP + +#if defined(HEDLEY_PRINTF_FORMAT) + #undef HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + HEDLEY_HAS_ATTRIBUTE(format) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(HEDLEY_CONSTEXPR) + #undef HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define HEDLEY_CONSTEXPR constexpr + #endif +#endif +#if !defined(HEDLEY_CONSTEXPR) + #define HEDLEY_CONSTEXPR +#endif + +#if defined(HEDLEY_PREDICT) + #undef HEDLEY_PREDICT +#endif +#if defined(HEDLEY_LIKELY) + #undef HEDLEY_LIKELY +#endif +#if defined(HEDLEY_UNLIKELY) + #undef HEDLEY_UNLIKELY +#endif +#if defined(HEDLEY_UNPREDICTABLE) + #undef HEDLEY_UNPREDICTABLE +#endif +#if HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) +#endif +#if \ + HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) +# define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) +# define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) +# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#if !defined(HEDLEY_BUILTIN_UNPREDICTABLE) + #define HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) +#endif +#elif \ + HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,27) +# define HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void) (expected)), !!(expr))) +# define HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) +# define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define HEDLEY_LIKELY(expr) (!!(expr)) +# define HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(HEDLEY_UNPREDICTABLE) + #define HEDLEY_UNPREDICTABLE(expr) HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(HEDLEY_MALLOC) + #undef HEDLEY_MALLOC +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(malloc) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_MALLOC __attribute__((__malloc__)) +#elif HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define HEDLEY_MALLOC __declspec(restrict) +#else + #define HEDLEY_MALLOC +#endif + +#if defined(HEDLEY_PURE) + #undef HEDLEY_PURE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(pure) || \ + HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_PURE __attribute__((__pure__)) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else + #define HEDLEY_PURE +#endif + +#if defined(HEDLEY_CONST) + #undef HEDLEY_CONST +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(const) || \ + HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define HEDLEY_CONST __attribute__((__const__)) +#else + #define HEDLEY_CONST HEDLEY_PURE +#endif + +#if defined(HEDLEY_RESTRICT) + #undef HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define HEDLEY_RESTRICT restrict +#elif \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) + #define HEDLEY_RESTRICT __restrict +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define HEDLEY_RESTRICT _Restrict +#else + #define HEDLEY_RESTRICT +#endif + +#if defined(HEDLEY_INLINE) + #undef HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define HEDLEY_INLINE inline +#elif \ + defined(HEDLEY_GCC_VERSION) || \ + HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define HEDLEY_INLINE __inline__ +#elif \ + HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) + #define HEDLEY_INLINE __inline +#else + #define HEDLEY_INLINE +#endif + +#if defined(HEDLEY_ALWAYS_INLINE) + #undef HEDLEY_ALWAYS_INLINE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE +#elif HEDLEY_MSVC_VERSION_CHECK(12,0,0) + #define HEDLEY_ALWAYS_INLINE __forceinline +#elif HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) + #define HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else + #define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE +#endif + +#if defined(HEDLEY_NEVER_INLINE) + #undef HEDLEY_NEVER_INLINE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(noinline) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define HEDLEY_NEVER_INLINE __declspec(noinline) +#elif HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define HEDLEY_NEVER_INLINE +#endif + +#if defined(HEDLEY_PRIVATE) + #undef HEDLEY_PRIVATE +#endif +#if defined(HEDLEY_PUBLIC) + #undef HEDLEY_PUBLIC +#endif +#if defined(HEDLEY_IMPORT) + #undef HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) + #define HEDLEY_PRIVATE + #define HEDLEY_PUBLIC __declspec(dllexport) + #define HEDLEY_IMPORT __declspec(dllimport) +#else + #if \ + HEDLEY_HAS_ATTRIBUTE(visibility) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) + #define HEDLEY_PUBLIC __attribute__((__visibility__("default"))) + #else + #define HEDLEY_PRIVATE + #define HEDLEY_PUBLIC + #endif + #define HEDLEY_IMPORT extern +#endif + +#if defined(HEDLEY_NO_THROW) + #undef HEDLEY_NO_THROW +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define HEDLEY_NO_THROW __declspec(nothrow) +#else + #define HEDLEY_NO_THROW +#endif + +#if defined(HEDLEY_FALL_THROUGH) + #undef HEDLEY_FALL_THROUGH +#endif +#if \ + defined(__cplusplus) && \ + (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + !defined(HEDLEY_PGI_VERSION) + #if \ + (__cplusplus >= 201703L) || \ + ((__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) + #define HEDLEY_FALL_THROUGH [[fallthrough]] + #elif (__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) + #define HEDLEY_FALL_THROUGH [[clang::fallthrough]] + #elif (__cplusplus >= 201103L) && HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define HEDLEY_FALL_THROUGH [[gnu::fallthrough]] + #endif +#endif +#if !defined(HEDLEY_FALL_THROUGH) + #if HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(HEDLEY_PGI_VERSION) + #define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) + #elif defined(__fallthrough) /* SAL */ + #define HEDLEY_FALL_THROUGH __fallthrough + #else + #define HEDLEY_FALL_THROUGH + #endif +#endif + +#if defined(HEDLEY_RETURNS_NON_NULL) + #undef HEDLEY_RETURNS_NON_NULL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(HEDLEY_ARRAY_PARAM) + #undef HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(HEDLEY_PGI_VERSION) && \ + !defined(HEDLEY_TINYC_VERSION) + #define HEDLEY_ARRAY_PARAM(name) (name) +#else + #define HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(HEDLEY_IS_CONSTANT) + #undef HEDLEY_IS_CONSTANT +#endif +#if defined(HEDLEY_REQUIRE_CONSTEXPR) + #undef HEDLEY_REQUIRE_CONSTEXPR +#endif +/* Note the double-underscore. For internal use only; no API + * guarantees! */ +#if defined(HEDLEY__IS_CONSTEXPR) + #undef HEDLEY__IS_CONSTEXPR +#endif + +#if \ + HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ + HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(HEDLEY_SUNPRO_VERSION) && !defined(HEDLEY_PGI_VERSION)) || \ + HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(HEDLEY_GCC_VERSION) || \ + defined(HEDLEY_INTEL_VERSION) || \ + defined(HEDLEY_TINYC_VERSION) || \ + defined(HEDLEY_TI_VERSION) || \ + defined(__clang__) +# define HEDLEY__IS_CONSTEXPR(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(HEDLEY__IS_CONSTEXPR) + #if !defined(HEDLEY_IS_CONSTANT) + #define HEDLEY_IS_CONSTANT(expr) HEDLEY__IS_CONSTEXPR(expr) + #endif + #define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) +#else + #if !defined(HEDLEY_IS_CONSTANT) + #define HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(HEDLEY_BEGIN_C_DECLS) + #undef HEDLEY_BEGIN_C_DECLS +#endif +#if defined(HEDLEY_END_C_DECLS) + #undef HEDLEY_END_C_DECLS +#endif +#if defined(HEDLEY_C_DECL) + #undef HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define HEDLEY_BEGIN_C_DECLS extern "C" { + #define HEDLEY_END_C_DECLS } + #define HEDLEY_C_DECL extern "C" +#else + #define HEDLEY_BEGIN_C_DECLS + #define HEDLEY_END_C_DECLS + #define HEDLEY_C_DECL +#endif + +#if defined(HEDLEY_STATIC_ASSERT) + #undef HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + HEDLEY_HAS_FEATURE(c_static_assert) || \ + HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ + HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + (defined(__cplusplus) && HEDLEY_TI_VERSION_CHECK(8,3,0)) +# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) +#elif defined(__cplusplus) && (__cplusplus >= 201103L) +# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) +#else +# define HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(HEDLEY_CONST_CAST) + #undef HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + HEDLEY_HAS_WARNING("-Wcast-qual") || \ + HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(HEDLEY_REINTERPRET_CAST) + #undef HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) +#endif + +#if defined(HEDLEY_STATIC_CAST) + #undef HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(HEDLEY_CPP_CAST) + #undef HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) + #define HEDLEY_CPP_CAST(T, expr) static_cast(expr) +#else + #define HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(HEDLEY_MESSAGE) + #undef HEDLEY_MESSAGE +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define HEDLEY_MESSAGE(msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + HEDLEY_PRAGMA(message msg) \ + HEDLEY_DIAGNOSTIC_POP +#elif \ + HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message msg) +#elif HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(_CRI message msg) +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) +#elif HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) +#else +# define HEDLEY_MESSAGE(msg) +#endif + +#if defined(HEDLEY_WARNING) + #undef HEDLEY_WARNING +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define HEDLEY_WARNING(msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + HEDLEY_PRAGMA(clang warning msg) \ + HEDLEY_DIAGNOSTIC_POP +#elif \ + HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + HEDLEY_PGI_VERSION_CHECK(18,4,0) +# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg) +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg)) +#else +# define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg) +#endif + +#if defined(HEDLEY_REQUIRE_MSG) + #undef HEDLEY_REQUIRE_MSG +#endif +#if HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if HEDLEY_HAS_WARNING("-Wgcc-compat") +# define HEDLEY_REQUIRE_MSG(expr, msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((__diagnose_if__(!(expr), msg, "error"))) \ + HEDLEY_DIAGNOSTIC_POP +# else +# define HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) +# endif +#else +# define HEDLEY_REQUIRE_MSG(expr, msg) +#endif + +#if defined(HEDLEY_REQUIRE) + #undef HEDLEY_REQUIRE +#endif +#define HEDLEY_REQUIRE(expr) HEDLEY_REQUIRE_MSG(expr, #expr) + +#if defined(HEDLEY_FLAGS) + #undef HEDLEY_FLAGS +#endif +#if HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define HEDLEY_FLAGS __attribute__((__flag_enum__)) +#endif + +#if defined(HEDLEY_FLAGS_CAST) + #undef HEDLEY_FLAGS_CAST +#endif +#if HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define HEDLEY_FLAGS_CAST(T, expr) HEDLEY_STATIC_CAST(T, expr) +#endif + +/* Remaining macros are deprecated. */ + +#if defined(HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_BUILTIN) + #undef HEDLEY_CLANG_HAS_BUILTIN +#endif +#define HEDLEY_CLANG_HAS_BUILTIN(builtin) HEDLEY_HAS_BUILTIN(builtin) + +#if defined(HEDLEY_CLANG_HAS_FEATURE) + #undef HEDLEY_CLANG_HAS_FEATURE +#endif +#define HEDLEY_CLANG_HAS_FEATURE(feature) HEDLEY_HAS_FEATURE(feature) + +#if defined(HEDLEY_CLANG_HAS_EXTENSION) + #undef HEDLEY_CLANG_HAS_EXTENSION +#endif +#define HEDLEY_CLANG_HAS_EXTENSION(extension) HEDLEY_HAS_EXTENSION(extension) + +#if defined(HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_WARNING) + #undef HEDLEY_CLANG_HAS_WARNING +#endif +#define HEDLEY_CLANG_HAS_WARNING(warning) HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 +#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 +#endif + +// disable float-equal warnings on GCC/clang +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdocumentation" +#endif + +// allow to disable exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + namespace nlohmann { @@ -146,6 +1775,7 @@ class exception : public std::exception { public: /// returns the explanatory string + HEDLEY_RETURNS_NON_NULL const char* what() const noexcept override { return m.what(); @@ -155,6 +1785,7 @@ class exception : public std::exception const int id; protected: + HEDLEY_NON_NULL(3) exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} static std::string name(const std::string& ename, int id_) @@ -307,6 +1938,7 @@ class invalid_iterator : public exception } private: + HEDLEY_NON_NULL(3) invalid_iterator(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -360,6 +1992,7 @@ class type_error : public exception } private: + HEDLEY_NON_NULL(3) type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -406,6 +2039,7 @@ class out_of_range : public exception } private: + HEDLEY_NON_NULL(3) out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -443,6 +2077,7 @@ class other_error : public exception } private: + HEDLEY_NON_NULL(3) other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; } // namespace detail @@ -450,161 +2085,6 @@ class other_error : public exception // #include - -#include // pair - -// This file contains all internal macro definitions -// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them - -// exclude unsupported compilers -#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) - #if defined(__clang__) - #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 - #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" - #endif - #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) - #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 - #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" - #endif - #endif -#endif - -// C++ language standard detection -#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 - #define JSON_HAS_CPP_17 - #define JSON_HAS_CPP_14 -#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) - #define JSON_HAS_CPP_14 -#endif - -// disable float-equal warnings on GCC/clang -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wfloat-equal" -#endif - -// disable documentation warnings on clang -#if defined(__clang__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdocumentation" -#endif - -// allow for portable deprecation warnings -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) - #define JSON_DEPRECATED __declspec(deprecated) -#else - #define JSON_DEPRECATED -#endif - -// allow for portable nodiscard warnings -#if defined(__has_cpp_attribute) - #if __has_cpp_attribute(nodiscard) - #if defined(__clang__) && !defined(JSON_HAS_CPP_17) // issue #1535 - #define JSON_NODISCARD - #else - #define JSON_NODISCARD [[nodiscard]] - #endif - #elif __has_cpp_attribute(gnu::warn_unused_result) - #define JSON_NODISCARD [[gnu::warn_unused_result]] - #else - #define JSON_NODISCARD - #endif -#else - #define JSON_NODISCARD -#endif - -// allow to disable exceptions -#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) - #define JSON_THROW(exception) throw exception - #define JSON_TRY try - #define JSON_CATCH(exception) catch(exception) - #define JSON_INTERNAL_CATCH(exception) catch(exception) -#else - #include - #define JSON_THROW(exception) std::abort() - #define JSON_TRY if(true) - #define JSON_CATCH(exception) if(false) - #define JSON_INTERNAL_CATCH(exception) if(false) -#endif - -// override exception macros -#if defined(JSON_THROW_USER) - #undef JSON_THROW - #define JSON_THROW JSON_THROW_USER -#endif -#if defined(JSON_TRY_USER) - #undef JSON_TRY - #define JSON_TRY JSON_TRY_USER -#endif -#if defined(JSON_CATCH_USER) - #undef JSON_CATCH - #define JSON_CATCH JSON_CATCH_USER - #undef JSON_INTERNAL_CATCH - #define JSON_INTERNAL_CATCH JSON_CATCH_USER -#endif -#if defined(JSON_INTERNAL_CATCH_USER) - #undef JSON_INTERNAL_CATCH - #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER -#endif - -// manual branch prediction -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_LIKELY(x) __builtin_expect(x, 1) - #define JSON_UNLIKELY(x) __builtin_expect(x, 0) -#else - #define JSON_LIKELY(x) x - #define JSON_UNLIKELY(x) x -#endif - -/*! -@brief macro to briefly define a mapping between an enum and JSON -@def NLOHMANN_JSON_SERIALIZE_ENUM -@since version 3.4.0 -*/ -#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ - template \ - inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ - { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if(std::begin(m), std::end(m), \ - [e](const std::pair& ej_pair) -> bool \ - { \ - return ej_pair.first == e; \ - }); \ - j = ((it != std::end(m)) ? it : std::begin(m))->second; \ - } \ - template \ - inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ - { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if(std::begin(m), std::end(m), \ - [j](const std::pair& ej_pair) -> bool \ - { \ - return ej_pair.second == j; \ - }); \ - e = ((it != std::end(m)) ? it : std::begin(m))->first; \ - } - -// Ugly macros to avoid uglier copy-paste when specializing basic_json. They -// may be removed in the future once the class is split. - -#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ - template class ObjectType, \ - template class ArrayType, \ - class StringType, class BooleanType, class NumberIntegerType, \ - class NumberUnsignedType, class NumberFloatType, \ - template class AllocatorType, \ - template class JSONSerializer> - -#define NLOHMANN_BASIC_JSON_TPL \ - basic_json - // #include @@ -1314,7 +2794,7 @@ namespace detail template void from_json(const BasicJsonType& j, typename std::nullptr_t& n) { - if (JSON_UNLIKELY(not j.is_null())) + if (HEDLEY_UNLIKELY(not j.is_null())) { JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); } @@ -1354,7 +2834,7 @@ void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) template void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) { - if (JSON_UNLIKELY(not j.is_boolean())) + if (HEDLEY_UNLIKELY(not j.is_boolean())) { JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); } @@ -1364,7 +2844,7 @@ void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) template void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) { - if (JSON_UNLIKELY(not j.is_string())) + if (HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -1380,7 +2860,7 @@ template < int > = 0 > void from_json(const BasicJsonType& j, ConstructibleStringType& s) { - if (JSON_UNLIKELY(not j.is_string())) + if (HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -1420,7 +2900,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::forward_list& l) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -1437,7 +2917,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::valarray& l) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -1524,7 +3004,7 @@ auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) j.template get(), void()) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); @@ -1537,7 +3017,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) { - if (JSON_UNLIKELY(not j.is_object())) + if (HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); } @@ -1620,14 +3100,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::map& m) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (JSON_UNLIKELY(not p.is_array())) + if (HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -1640,14 +3120,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::unordered_map& m) { - if (JSON_UNLIKELY(not j.is_array())) + if (HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (JSON_UNLIKELY(not p.is_array())) + if (HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -1674,7 +3154,7 @@ namespace { constexpr const auto& from_json = detail::static_const::value; } // namespace -} // namespace nlohmann +} // namespace nlohmann // #include @@ -2196,7 +3676,7 @@ namespace { constexpr const auto& to_json = detail::static_const::value; } // namespace -} // namespace nlohmann +} // namespace nlohmann namespace nlohmann @@ -2326,6 +3806,7 @@ Input adapter for stdio file access. This adapter read only 1 byte and do not us class file_input_adapter : public input_adapter_protocol { public: + HEDLEY_NON_NULL(2) explicit file_input_adapter(std::FILE* f) noexcept : m_file(f) {} @@ -2401,6 +3882,7 @@ class input_stream_adapter : public input_adapter_protocol class input_buffer_adapter : public input_adapter_protocol { public: + HEDLEY_NON_NULL(2) input_buffer_adapter(const char* b, const std::size_t l) noexcept : cursor(b), limit(b + l) {} @@ -2414,7 +3896,7 @@ class input_buffer_adapter : public input_adapter_protocol std::char_traits::int_type get_character() noexcept override { - if (JSON_LIKELY(cursor < limit)) + if (HEDLEY_LIKELY(cursor < limit)) { return std::char_traits::to_int_type(*(cursor++)); } @@ -2604,6 +4086,7 @@ class input_adapter { public: // native support + HEDLEY_NON_NULL(2) input_adapter(std::FILE* file) : ia(std::make_shared(file)) {} /// input adapter for input stream @@ -2672,7 +4155,7 @@ class input_adapter "each element in the iterator range must have the size of 1 byte"); const auto len = static_cast(std::distance(first, last)); - if (JSON_LIKELY(len > 0)) + if (HEDLEY_LIKELY(len > 0)) { // there is at least one element: use the address of first ia = std::make_shared(reinterpret_cast(&(*first)), len); @@ -2920,7 +4403,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); - if (JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); @@ -2946,7 +4429,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); - if (JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); @@ -3002,6 +4485,7 @@ class json_sax_dom_parser object to which we can add elements */ template + HEDLEY_RETURNS_NON_NULL BasicJsonType* handle_value(Value&& v) { if (ref_stack.empty()) @@ -3108,7 +4592,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check object limit - if (ref_stack.back() and JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); } @@ -3171,7 +4655,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check array limit - if (ref_stack.back() and JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); } @@ -3610,6 +5094,7 @@ class binary_reader @return */ + HEDLEY_NON_NULL(3) bool sax_parse(const input_format_t format, json_sax_t* sax_, const bool strict = true) @@ -3651,7 +5136,7 @@ class binary_reader get(); } - if (JSON_UNLIKELY(current != std::char_traits::eof())) + if (HEDLEY_UNLIKELY(current != std::char_traits::eof())) { return sax->parse_error(chars_read, get_token_string(), parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); @@ -3687,12 +5172,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (JSON_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } - if (JSON_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) + if (HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) { return false; } @@ -3713,7 +5198,7 @@ class binary_reader while (true) { get(); - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) { return false; } @@ -3741,7 +5226,7 @@ class binary_reader template bool get_bson_string(const NumberType len, string_t& result) { - if (JSON_UNLIKELY(len < 1)) + if (HEDLEY_UNLIKELY(len < 1)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); @@ -3836,13 +5321,13 @@ class binary_reader string_t key; while (int element_type = get()) { - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) { return false; } const std::size_t element_type_parse_position = chars_read; - if (JSON_UNLIKELY(not get_bson_cstr(key))) + if (HEDLEY_UNLIKELY(not get_bson_cstr(key))) { return false; } @@ -3852,7 +5337,7 @@ class binary_reader return false; } - if (JSON_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) + if (HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) { return false; } @@ -3873,12 +5358,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (JSON_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } - if (JSON_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) + if (HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) { return false; } @@ -4163,12 +5648,12 @@ class binary_reader case 0xF9: // Half-Precision Float (two-byte IEEE 754) { const int byte1_raw = get(); - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } const int byte2_raw = get(); - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } @@ -4241,7 +5726,7 @@ class binary_reader */ bool get_cbor_string(string_t& result) { - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) { return false; } @@ -4330,7 +5815,7 @@ class binary_reader */ bool get_cbor_array(const std::size_t len) { - if (JSON_UNLIKELY(not sax->start_array(len))) + if (HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } @@ -4339,7 +5824,7 @@ class binary_reader { for (std::size_t i = 0; i < len; ++i) { - if (JSON_UNLIKELY(not parse_cbor_internal())) + if (HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -4349,7 +5834,7 @@ class binary_reader { while (get() != 0xFF) { - if (JSON_UNLIKELY(not parse_cbor_internal(false))) + if (HEDLEY_UNLIKELY(not parse_cbor_internal(false))) { return false; } @@ -4366,7 +5851,7 @@ class binary_reader */ bool get_cbor_object(const std::size_t len) { - if (JSON_UNLIKELY(not sax->start_object(len))) + if (HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -4377,12 +5862,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_cbor_internal())) + if (HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -4393,12 +5878,12 @@ class binary_reader { while (get() != 0xFF) { - if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_cbor_internal())) + if (HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -4787,7 +6272,7 @@ class binary_reader */ bool get_msgpack_string(string_t& result) { - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) { return false; } @@ -4863,14 +6348,14 @@ class binary_reader */ bool get_msgpack_array(const std::size_t len) { - if (JSON_UNLIKELY(not sax->start_array(len))) + if (HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } for (std::size_t i = 0; i < len; ++i) { - if (JSON_UNLIKELY(not parse_msgpack_internal())) + if (HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -4885,7 +6370,7 @@ class binary_reader */ bool get_msgpack_object(const std::size_t len) { - if (JSON_UNLIKELY(not sax->start_object(len))) + if (HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -4894,12 +6379,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (JSON_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_msgpack_internal())) + if (HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -4946,7 +6431,7 @@ class binary_reader get(); // TODO(niels): may we ignore N here? } - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -5000,7 +6485,7 @@ class binary_reader case 'U': { std::uint8_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -5011,7 +6496,7 @@ class binary_reader case 'i': { std::int8_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -5022,7 +6507,7 @@ class binary_reader case 'I': { std::int16_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -5033,7 +6518,7 @@ class binary_reader case 'l': { std::int32_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -5044,7 +6529,7 @@ class binary_reader case 'L': { std::int64_t number; - if (JSON_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -5080,15 +6565,15 @@ class binary_reader if (current == '$') { result.second = get(); // must not ignore 'N', because 'N' maybe the type - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) { return false; } get_ignore_noop(); - if (JSON_UNLIKELY(current != '#')) + if (HEDLEY_UNLIKELY(current != '#')) { - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -5171,11 +6656,11 @@ class binary_reader case 'C': // char { get(); - if (JSON_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) { return false; } - if (JSON_UNLIKELY(current > 127)) + if (HEDLEY_UNLIKELY(current > 127)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); @@ -5210,14 +6695,14 @@ class binary_reader bool get_ubjson_array() { std::pair size_and_type; - if (JSON_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } if (size_and_type.first != string_t::npos) { - if (JSON_UNLIKELY(not sax->start_array(size_and_type.first))) + if (HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) { return false; } @@ -5228,7 +6713,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -5239,7 +6724,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (JSON_UNLIKELY(not parse_ubjson_internal())) + if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -5248,14 +6733,14 @@ class binary_reader } else { - if (JSON_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } while (current != ']') { - if (JSON_UNLIKELY(not parse_ubjson_internal(false))) + if (HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) { return false; } @@ -5272,7 +6757,7 @@ class binary_reader bool get_ubjson_object() { std::pair size_and_type; - if (JSON_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } @@ -5280,7 +6765,7 @@ class binary_reader string_t key; if (size_and_type.first != string_t::npos) { - if (JSON_UNLIKELY(not sax->start_object(size_and_type.first))) + if (HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) { return false; } @@ -5289,11 +6774,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -5304,11 +6789,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_ubjson_internal())) + if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -5318,18 +6803,18 @@ class binary_reader } else { - if (JSON_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } while (current != '}') { - if (JSON_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) + if (HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) { return false; } - if (JSON_UNLIKELY(not parse_ubjson_internal())) + if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -5395,7 +6880,7 @@ class binary_reader for (std::size_t i = 0; i < sizeof(NumberType); ++i) { get(); - if (JSON_UNLIKELY(not unexpect_eof(format, "number"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) { return false; } @@ -5439,7 +6924,7 @@ class binary_reader std::generate_n(std::back_inserter(result), len, [this, &success, &format]() { get(); - if (JSON_UNLIKELY(not unexpect_eof(format, "string"))) + if (HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) { success = false; } @@ -5453,9 +6938,10 @@ class binary_reader @param[in] context further context information (for diagnostics) @return whether the last read character is not EOF */ + HEDLEY_NON_NULL(3) bool unexpect_eof(const input_format_t format, const char* context) const { - if (JSON_UNLIKELY(current == std::char_traits::eof())) + if (HEDLEY_UNLIKELY(current == std::char_traits::eof())) { return sax->parse_error(chars_read, "", parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); @@ -5596,6 +7082,7 @@ class lexer }; /// return name of values of type token_type (only used for errors) + HEDLEY_RETURNS_NON_NULL static const char* token_type_name(const token_type t) noexcept { switch (t) @@ -5737,7 +7224,7 @@ class lexer for (auto range = ranges.begin(); range != ranges.end(); ++range) { get(); - if (JSON_LIKELY(*range <= current and current <= *(++range))) + if (HEDLEY_LIKELY(*range <= current and current <= *(++range))) { add(current); } @@ -5836,7 +7323,7 @@ class lexer const int codepoint1 = get_codepoint(); int codepoint = codepoint1; // start with codepoint1 - if (JSON_UNLIKELY(codepoint1 == -1)) + if (HEDLEY_UNLIKELY(codepoint1 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; @@ -5846,18 +7333,18 @@ class lexer if (0xD800 <= codepoint1 and codepoint1 <= 0xDBFF) { // expect next \uxxxx entry - if (JSON_LIKELY(get() == '\\' and get() == 'u')) + if (HEDLEY_LIKELY(get() == '\\' and get() == 'u')) { const int codepoint2 = get_codepoint(); - if (JSON_UNLIKELY(codepoint2 == -1)) + if (HEDLEY_UNLIKELY(codepoint2 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; } // check if codepoint2 is a low surrogate - if (JSON_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) + if (HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) { // overwrite codepoint codepoint = static_cast( @@ -5884,7 +7371,7 @@ class lexer } else { - if (JSON_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) + if (HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) { error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; return token_type::parse_error; @@ -6259,7 +7746,7 @@ class lexer case 0xDE: case 0xDF: { - if (JSON_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) + if (HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) { return token_type::parse_error; } @@ -6269,7 +7756,7 @@ class lexer // U+0800..U+0FFF: bytes E0 A0..BF 80..BF case 0xE0: { - if (JSON_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -6293,7 +7780,7 @@ class lexer case 0xEE: case 0xEF: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -6303,7 +7790,7 @@ class lexer // U+D000..U+D7FF: bytes ED 80..9F 80..BF case 0xED: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -6313,7 +7800,7 @@ class lexer // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF case 0xF0: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -6325,7 +7812,7 @@ class lexer case 0xF2: case 0xF3: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -6335,7 +7822,7 @@ class lexer // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF case 0xF4: { - if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -6352,16 +7839,19 @@ class lexer } } + HEDLEY_NON_NULL(2) static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } + HEDLEY_NON_NULL(2) static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } + HEDLEY_NON_NULL(2) static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); @@ -6737,13 +8227,14 @@ scan_number_done: @param[in] length the length of the passed literal text @param[in] return_type the token type to return on success */ + HEDLEY_NON_NULL(2) token_type scan_literal(const char* literal_text, const std::size_t length, token_type return_type) { assert(current == literal_text[0]); for (std::size_t i = 1; i < length; ++i) { - if (JSON_UNLIKELY(get() != literal_text[i])) + if (HEDLEY_UNLIKELY(get() != literal_text[i])) { error_message = "invalid literal"; return token_type::parse_error; @@ -6789,7 +8280,7 @@ scan_number_done: current = ia->get_character(); } - if (JSON_LIKELY(current != std::char_traits::eof())) + if (HEDLEY_LIKELY(current != std::char_traits::eof())) { token_string.push_back(std::char_traits::to_char_type(current)); } @@ -6830,7 +8321,7 @@ scan_number_done: --position.chars_read_current_line; } - if (JSON_LIKELY(current != std::char_traits::eof())) + if (HEDLEY_LIKELY(current != std::char_traits::eof())) { assert(not token_string.empty()); token_string.pop_back(); @@ -6909,6 +8400,7 @@ scan_number_done: } /// return syntax error message + HEDLEY_RETURNS_NON_NULL constexpr const char* get_error_message() const noexcept { return error_message; @@ -7197,6 +8689,7 @@ class parser } template + HEDLEY_NON_NULL(2) bool sax_parse(SAX* sax, const bool strict = true) { (void)detail::is_sax_static_asserts {}; @@ -7216,6 +8709,7 @@ class parser private: template + HEDLEY_NON_NULL(2) bool sax_parse_internal(SAX* sax) { // stack to remember the hierarchy of structured values we are parsing @@ -7233,7 +8727,7 @@ class parser { case token_type::begin_object: { - if (JSON_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } @@ -7241,7 +8735,7 @@ class parser // closing } -> we are done if (get_token() == token_type::end_object) { - if (JSON_UNLIKELY(not sax->end_object())) + if (HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -7249,20 +8743,20 @@ class parser } // parse key - if (JSON_UNLIKELY(last_token != token_type::value_string)) + if (HEDLEY_UNLIKELY(last_token != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"))); } - if (JSON_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (JSON_UNLIKELY(get_token() != token_type::name_separator)) + if (HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -7280,7 +8774,7 @@ class parser case token_type::begin_array: { - if (JSON_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } @@ -7288,7 +8782,7 @@ class parser // closing ] -> we are done if (get_token() == token_type::end_array) { - if (JSON_UNLIKELY(not sax->end_array())) + if (HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -7306,14 +8800,14 @@ class parser { const auto res = m_lexer.get_number_float(); - if (JSON_UNLIKELY(not std::isfinite(res))) + if (HEDLEY_UNLIKELY(not std::isfinite(res))) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); } - if (JSON_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) + if (HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) { return false; } @@ -7323,7 +8817,7 @@ class parser case token_type::literal_false: { - if (JSON_UNLIKELY(not sax->boolean(false))) + if (HEDLEY_UNLIKELY(not sax->boolean(false))) { return false; } @@ -7332,7 +8826,7 @@ class parser case token_type::literal_null: { - if (JSON_UNLIKELY(not sax->null())) + if (HEDLEY_UNLIKELY(not sax->null())) { return false; } @@ -7341,7 +8835,7 @@ class parser case token_type::literal_true: { - if (JSON_UNLIKELY(not sax->boolean(true))) + if (HEDLEY_UNLIKELY(not sax->boolean(true))) { return false; } @@ -7350,7 +8844,7 @@ class parser case token_type::value_integer: { - if (JSON_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) + if (HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) { return false; } @@ -7359,7 +8853,7 @@ class parser case token_type::value_string: { - if (JSON_UNLIKELY(not sax->string(m_lexer.get_string()))) + if (HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) { return false; } @@ -7368,7 +8862,7 @@ class parser case token_type::value_unsigned: { - if (JSON_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) + if (HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) { return false; } @@ -7416,9 +8910,9 @@ class parser } // closing ] - if (JSON_LIKELY(last_token == token_type::end_array)) + if (HEDLEY_LIKELY(last_token == token_type::end_array)) { - if (JSON_UNLIKELY(not sax->end_array())) + if (HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -7444,7 +8938,7 @@ class parser if (get_token() == token_type::value_separator) { // parse key - if (JSON_UNLIKELY(get_token() != token_type::value_string)) + if (HEDLEY_UNLIKELY(get_token() != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -7452,13 +8946,13 @@ class parser exception_message(token_type::value_string, "object key"))); } - if (JSON_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (JSON_UNLIKELY(get_token() != token_type::name_separator)) + if (HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -7472,9 +8966,9 @@ class parser } // closing } - if (JSON_LIKELY(last_token == token_type::end_object)) + if (HEDLEY_LIKELY(last_token == token_type::end_object)) { - if (JSON_UNLIKELY(not sax->end_object())) + if (HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -7829,7 +9323,8 @@ class iter_impl information refer to: https://github.com/nlohmann/json/issues/1608 */ iter_impl(const iter_impl& other) noexcept - : m_object(other.m_object), m_it(other.m_it) {} + : m_object(other.m_object), m_it(other.m_it) + {} /*! @brief converting constructor @@ -7837,7 +9332,8 @@ class iter_impl @note It is not checked whether @a other is initialized. */ iter_impl(const iter_impl::type>& other) noexcept - : m_object(other.m_object), m_it(other.m_it) {} + : m_object(other.m_object), m_it(other.m_it) + {} /*! @brief converting assignment @@ -7852,6 +9348,14 @@ class iter_impl return *this; } + /// @copydoc operator=(const iter_impl::type>&) + iter_impl& operator=(const iter_impl& other) noexcept + { + m_object = other.m_object; + m_it = other.m_it; + return *this; + } + private: /*! @brief set the iterator to the first value @@ -7948,7 +9452,7 @@ class iter_impl default: { - if (JSON_LIKELY(m_it.primitive_iterator.is_begin())) + if (HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return *m_object; } @@ -7982,7 +9486,7 @@ class iter_impl default: { - if (JSON_LIKELY(m_it.primitive_iterator.is_begin())) + if (HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return m_object; } @@ -8085,7 +9589,7 @@ class iter_impl bool operator==(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (JSON_UNLIKELY(m_object != other.m_object)) + if (HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -8121,7 +9625,7 @@ class iter_impl bool operator<(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (JSON_UNLIKELY(m_object != other.m_object)) + if (HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -8281,7 +9785,7 @@ class iter_impl default: { - if (JSON_LIKELY(m_it.primitive_iterator.get_value() == -n)) + if (HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) { return *m_object; } @@ -8299,7 +9803,7 @@ class iter_impl { assert(m_object != nullptr); - if (JSON_LIKELY(m_object->is_object())) + if (HEDLEY_LIKELY(m_object->is_object())) { return m_it.object_iterator->first; } @@ -8322,7 +9826,7 @@ class iter_impl /// the actual iterator of the associated instance internal_iterator::type> m_it {}; }; -} // namespace detail +} // namespace detail } // namespace nlohmann // #include @@ -8700,7 +10204,7 @@ class json_pointer */ void pop_back() { - if (JSON_UNLIKELY(empty())) + if (HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -8724,7 +10228,7 @@ class json_pointer */ const std::string& back() { - if (JSON_UNLIKELY(empty())) + if (HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -8788,7 +10292,7 @@ class json_pointer const int res = std::stoi(s, &processed_chars); // check if the string was completely read - if (JSON_UNLIKELY(processed_chars != s.size())) + if (HEDLEY_UNLIKELY(processed_chars != s.size())) { JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); } @@ -8798,7 +10302,7 @@ class json_pointer json_pointer top() const { - if (JSON_UNLIKELY(empty())) + if (HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -8930,7 +10434,7 @@ class json_pointer case detail::value_t::array: { // error condition (cf. RFC 6901, Sect. 4) - if (JSON_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -8988,7 +10492,7 @@ class json_pointer case detail::value_t::array: { - if (JSON_UNLIKELY(reference_token == "-")) + if (HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -8997,7 +10501,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (JSON_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -9053,7 +10557,7 @@ class json_pointer case detail::value_t::array: { - if (JSON_UNLIKELY(reference_token == "-")) + if (HEDLEY_UNLIKELY(reference_token == "-")) { // "-" cannot be used for const access JSON_THROW(detail::out_of_range::create(402, @@ -9062,7 +10566,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (JSON_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -9112,7 +10616,7 @@ class json_pointer case detail::value_t::array: { - if (JSON_UNLIKELY(reference_token == "-")) + if (HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -9121,7 +10625,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (JSON_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -9168,7 +10672,7 @@ class json_pointer } // check if nonempty reference string begins with slash - if (JSON_UNLIKELY(reference_string[0] != '/')) + if (HEDLEY_UNLIKELY(reference_string[0] != '/')) { JSON_THROW(detail::parse_error::create(107, 1, "JSON pointer must be empty or begin with '/' - was: '" + @@ -9203,9 +10707,9 @@ class json_pointer assert(reference_token[pos] == '~'); // ~ must be followed by 0 or 1 - if (JSON_UNLIKELY(pos == reference_token.size() - 1 or - (reference_token[pos + 1] != '0' and - reference_token[pos + 1] != '1'))) + if (HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or + (reference_token[pos + 1] != '0' and + reference_token[pos + 1] != '1'))) { JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); } @@ -9330,7 +10834,7 @@ class json_pointer static BasicJsonType unflatten(const BasicJsonType& value) { - if (JSON_UNLIKELY(not value.is_object())) + if (HEDLEY_UNLIKELY(not value.is_object())) { JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); } @@ -9340,7 +10844,7 @@ class json_pointer // iterate the JSON object values for (const auto& element : *value.m_value.object) { - if (JSON_UNLIKELY(not element.second.is_primitive())) + if (HEDLEY_UNLIKELY(not element.second.is_primitive())) { JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); } @@ -9484,6 +10988,8 @@ class json_ref // #include +// #include + // #include @@ -9495,6 +11001,8 @@ class json_ref #include // basic_ostream #include // basic_string #include // vector +// #include + namespace nlohmann { @@ -9526,6 +11034,7 @@ class output_vector_adapter : public output_adapter_protocol v.push_back(c); } + HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { std::copy(s, s + length, std::back_inserter(v)); @@ -9549,6 +11058,7 @@ class output_stream_adapter : public output_adapter_protocol stream.put(c); } + HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { stream.write(s, static_cast(length)); @@ -9572,6 +11082,7 @@ class output_string_adapter : public output_adapter_protocol str.push_back(c); } + HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { str.append(s, length); @@ -10310,7 +11821,7 @@ class binary_writer static std::size_t calc_bson_entry_header_size(const string_t& name) { const auto it = name.find(static_cast(0)); - if (JSON_UNLIKELY(it != BasicJsonType::string_t::npos)) + if (HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) { JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); @@ -10960,6 +12471,8 @@ class binary_writer #include // memcpy, memmove #include // numeric_limits #include // conditional +// #include + namespace nlohmann { @@ -11770,6 +13283,7 @@ v = buf * 10^decimal_exponent len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ +HEDLEY_NON_NULL(1) inline void grisu2(char* buf, int& len, int& decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) { @@ -11829,6 +13343,7 @@ len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ template +HEDLEY_NON_NULL(1) void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) { static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, @@ -11867,6 +13382,8 @@ void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) @return a pointer to the element following the exponent. @pre -1000 < e < 1000 */ +HEDLEY_NON_NULL(1) +HEDLEY_RETURNS_NON_NULL inline char* append_exponent(char* buf, int e) { assert(e > -1000); @@ -11917,6 +13434,8 @@ notation. Otherwise it will be printed in exponential notation. @pre min_exp < 0 @pre max_exp > 0 */ +HEDLEY_NON_NULL(1) +HEDLEY_RETURNS_NON_NULL inline char* format_buffer(char* buf, int len, int decimal_exponent, int min_exp, int max_exp) { @@ -12000,6 +13519,8 @@ format. Returns an iterator pointing past-the-end of the decimal representation. @note The result is NOT null-terminated. */ template +HEDLEY_NON_NULL(1, 2) +HEDLEY_RETURNS_NON_NULL char* to_chars(char* first, const char* last, FloatType value) { static_cast(last); // maybe unused - fix warning @@ -12149,7 +13670,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (JSON_UNLIKELY(indent_string.size() < new_indent)) + if (HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -12222,7 +13743,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (JSON_UNLIKELY(indent_string.size() < new_indent)) + if (HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -12537,7 +14058,7 @@ class serializer } // we finished processing the string - if (JSON_LIKELY(state == UTF8_ACCEPT)) + if (HEDLEY_LIKELY(state == UTF8_ACCEPT)) { // write buffer if (bytes > 0) @@ -13130,7 +14651,7 @@ class basic_json @since 2.1.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json meta() { basic_json result; @@ -13635,6 +15156,7 @@ class basic_json /// helper for exception-safe object creation template + HEDLEY_RETURNS_NON_NULL static T* create(Args&& ... args) { AllocatorType alloc; @@ -13761,7 +15283,7 @@ class basic_json default: { object = nullptr; // silence warning, see #821 - if (JSON_UNLIKELY(t == value_t::null)) + if (HEDLEY_UNLIKELY(t == value_t::null)) { JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.6.1")); // LCOV_EXCL_LINE } @@ -14238,7 +15760,7 @@ class basic_json } // if object is wanted but impossible, throw an exception - if (JSON_UNLIKELY(manual_type == value_t::object and not is_an_object)) + if (HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) { JSON_THROW(type_error::create(301, "cannot create object from initializer list")); } @@ -14305,7 +15827,7 @@ class basic_json @since version 1.0.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json array(initializer_list_t init = {}) { return basic_json(init, false, value_t::array); @@ -14349,7 +15871,7 @@ class basic_json @since version 1.0.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json object(initializer_list_t init = {}) { return basic_json(init, false, value_t::object); @@ -14448,7 +15970,7 @@ class basic_json assert(last.m_object != nullptr); // make sure iterator fits the current value - if (JSON_UNLIKELY(first.m_object != last.m_object)) + if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); } @@ -14465,8 +15987,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (JSON_UNLIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -15179,7 +16701,7 @@ class basic_json /// get a boolean (explicit) boolean_t get_impl(boolean_t* /*unused*/) const { - if (JSON_LIKELY(is_boolean())) + if (HEDLEY_LIKELY(is_boolean())) { return m_value.boolean; } @@ -15288,7 +16810,7 @@ class basic_json // delegate the call to get_ptr<>() auto ptr = obj.template get_ptr::type>(); - if (JSON_LIKELY(ptr != nullptr)) + if (HEDLEY_LIKELY(ptr != nullptr)) { return *ptr; } @@ -15739,7 +17261,7 @@ class basic_json reference at(size_type idx) { // at only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -15786,7 +17308,7 @@ class basic_json const_reference at(size_type idx) const { // at only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -15837,7 +17359,7 @@ class basic_json reference at(const typename object_t::key_type& key) { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -15888,7 +17410,7 @@ class basic_json const_reference at(const typename object_t::key_type& key) const { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -15942,7 +17464,7 @@ class basic_json } // operator[] only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { // fill up array with null values if given idx is outside range if (idx >= m_value.array->size()) @@ -15980,7 +17502,7 @@ class basic_json const_reference operator[](size_type idx) const { // const operator[] only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { return m_value.array->operator[](idx); } @@ -16026,7 +17548,7 @@ class basic_json } // operator[] only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -16067,7 +17589,7 @@ class basic_json const_reference operator[](const typename object_t::key_type& key) const { // const operator[] only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -16104,6 +17626,7 @@ class basic_json @since version 1.1.0 */ template + HEDLEY_NON_NULL(2) reference operator[](T* key) { // implicitly convert null to object @@ -16115,7 +17638,7 @@ class basic_json } // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -16154,10 +17677,11 @@ class basic_json @since version 1.1.0 */ template + HEDLEY_NON_NULL(2) const_reference operator[](T* key) const { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -16221,7 +17745,7 @@ class basic_json ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { // if key is found, return value and given default value otherwise const auto it = find(key); @@ -16293,7 +17817,7 @@ class basic_json ValueType value(const json_pointer& ptr, const ValueType& default_value) const { // at only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { // if pointer resolves a value, return it or use default value JSON_TRY @@ -16313,6 +17837,7 @@ class basic_json @brief overload for a default value of type const char* @copydoc basic_json::value(const json_pointer&, ValueType) const */ + HEDLEY_NON_NULL(3) string_t value(const json_pointer& ptr, const char* default_value) const { return value(ptr, string_t(default_value)); @@ -16457,7 +17982,7 @@ class basic_json IteratorType erase(IteratorType pos) { // make sure iterator fits the current value - if (JSON_UNLIKELY(this != pos.m_object)) + if (HEDLEY_UNLIKELY(this != pos.m_object)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -16472,7 +17997,7 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (JSON_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) + if (HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) { JSON_THROW(invalid_iterator::create(205, "iterator out of range")); } @@ -16562,7 +18087,7 @@ class basic_json IteratorType erase(IteratorType first, IteratorType last) { // make sure iterator fits the current value - if (JSON_UNLIKELY(this != first.m_object or this != last.m_object)) + if (HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) { JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); } @@ -16577,8 +18102,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (JSON_LIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -16649,7 +18174,7 @@ class basic_json size_type erase(const typename object_t::key_type& key) { // this erase only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { return m_value.object->erase(key); } @@ -16684,9 +18209,9 @@ class basic_json void erase(const size_type idx) { // this erase only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { - if (JSON_UNLIKELY(idx >= size())) + if (HEDLEY_UNLIKELY(idx >= size())) { JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); } @@ -17162,7 +18687,7 @@ class basic_json future 4.0.0 of the library. Please use @ref items() instead; that is, replace `json::iterator_wrapper(j)` with `j.items()`. */ - JSON_DEPRECATED + HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(reference ref) noexcept { return ref.items(); @@ -17171,7 +18696,7 @@ class basic_json /*! @copydoc iterator_wrapper(reference) */ - JSON_DEPRECATED + HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(const_reference ref) noexcept { return ref.items(); @@ -17590,7 +19115,7 @@ class basic_json void push_back(basic_json&& val) { // push_back only works for null objects or arrays - if (JSON_UNLIKELY(not(is_null() or is_array()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -17627,7 +19152,7 @@ class basic_json void push_back(const basic_json& val) { // push_back only works for null objects or arrays - if (JSON_UNLIKELY(not(is_null() or is_array()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -17677,7 +19202,7 @@ class basic_json void push_back(const typename object_t::value_type& val) { // push_back only works for null objects or objects - if (JSON_UNLIKELY(not(is_null() or is_object()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -17778,7 +19303,7 @@ class basic_json void emplace_back(Args&& ... args) { // emplace_back only works for null objects or arrays - if (JSON_UNLIKELY(not(is_null() or is_array()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); } @@ -17826,7 +19351,7 @@ class basic_json std::pair emplace(Args&& ... args) { // emplace only works for null objects or arrays - if (JSON_UNLIKELY(not(is_null() or is_object()))) + if (HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); } @@ -17894,10 +19419,10 @@ class basic_json iterator insert(const_iterator pos, const basic_json& val) { // insert only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (JSON_UNLIKELY(pos.m_object != this)) + if (HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -17945,10 +19470,10 @@ class basic_json iterator insert(const_iterator pos, size_type cnt, const basic_json& val) { // insert only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (JSON_UNLIKELY(pos.m_object != this)) + if (HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -17993,24 +19518,24 @@ class basic_json iterator insert(const_iterator pos, const_iterator first, const_iterator last) { // insert only works for arrays - if (JSON_UNLIKELY(not is_array())) + if (HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (JSON_UNLIKELY(pos.m_object != this)) + if (HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } // check if range iterators belong to the same JSON object - if (JSON_UNLIKELY(first.m_object != last.m_object)) + if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } - if (JSON_UNLIKELY(first.m_object == this)) + if (HEDLEY_UNLIKELY(first.m_object == this)) { JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); } @@ -18046,13 +19571,13 @@ class basic_json iterator insert(const_iterator pos, initializer_list_t ilist) { // insert only works for arrays - if (JSON_UNLIKELY(not is_array())) + if (HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (JSON_UNLIKELY(pos.m_object != this)) + if (HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -18087,19 +19612,19 @@ class basic_json void insert(const_iterator first, const_iterator last) { // insert only works for objects - if (JSON_UNLIKELY(not is_object())) + if (HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (JSON_UNLIKELY(first.m_object != last.m_object)) + if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (JSON_UNLIKELY(not first.m_object->is_object())) + if (HEDLEY_UNLIKELY(not first.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -18136,11 +19661,11 @@ class basic_json assert_invariant(); } - if (JSON_UNLIKELY(not is_object())) + if (HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } - if (JSON_UNLIKELY(not j.is_object())) + if (HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); } @@ -18187,20 +19712,20 @@ class basic_json assert_invariant(); } - if (JSON_UNLIKELY(not is_object())) + if (HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (JSON_UNLIKELY(first.m_object != last.m_object)) + if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (JSON_UNLIKELY(not first.m_object->is_object() - or not last.m_object->is_object())) + if (HEDLEY_UNLIKELY(not first.m_object->is_object() + or not last.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -18263,7 +19788,7 @@ class basic_json void swap(array_t& other) { // swap only works for arrays - if (JSON_LIKELY(is_array())) + if (HEDLEY_LIKELY(is_array())) { std::swap(*(m_value.array), other); } @@ -18296,7 +19821,7 @@ class basic_json void swap(object_t& other) { // swap only works for objects - if (JSON_LIKELY(is_object())) + if (HEDLEY_LIKELY(is_object())) { std::swap(*(m_value.object), other); } @@ -18329,7 +19854,7 @@ class basic_json void swap(string_t& other) { // swap only works for strings - if (JSON_LIKELY(is_string())) + if (HEDLEY_LIKELY(is_string())) { std::swap(*(m_value.string), other); } @@ -18839,7 +20364,7 @@ class basic_json instead; that is, replace calls like `j >> o;` with `o << j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - JSON_DEPRECATED + HEDLEY_DEPRECATED(3.0.0) friend std::ostream& operator>>(const basic_json& j, std::ostream& o) { return o << j; @@ -18918,7 +20443,7 @@ class basic_json @since version 2.0.3 (contiguous containers) */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json parse(detail::input_adapter&& i, const parser_callback_t cb = nullptr, const bool allow_exceptions = true) @@ -18987,6 +20512,7 @@ class basic_json @since version 3.2.0 */ template + HEDLEY_NON_NULL(2) static bool sax_parse(detail::input_adapter&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true) @@ -19072,6 +20598,7 @@ class basic_json std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits::iterator_category>::value, int>::type = 0> + HEDLEY_NON_NULL(3) static bool sax_parse(IteratorType first, IteratorType last, SAX* sax) { return parser(detail::input_adapter(first, last)).sax_parse(sax); @@ -19085,7 +20612,7 @@ class basic_json instead; that is, replace calls like `j << i;` with `i >> j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - JSON_DEPRECATED + HEDLEY_DEPRECATED(3.0.0) friend std::istream& operator<<(basic_json& j, std::istream& i) { return operator>>(i, j); @@ -19158,6 +20685,7 @@ class basic_json @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` since 3.0.0 */ + HEDLEY_RETURNS_NON_NULL const char* type_name() const noexcept { { @@ -19687,7 +21215,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -19703,7 +21231,7 @@ class basic_json */ template::value, int> = 0> - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -19796,7 +21324,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -19812,7 +21340,7 @@ class basic_json */ template::value, int> = 0> - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -19884,7 +21412,7 @@ class basic_json @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -19900,7 +21428,7 @@ class basic_json */ template::value, int> = 0> - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -19971,7 +21499,7 @@ class basic_json @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the related UBJSON format */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -19987,7 +21515,7 @@ class basic_json */ template::value, int> = 0> - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -20361,7 +21889,7 @@ class basic_json else { const auto idx = json_pointer::array_index(last_path); - if (JSON_UNLIKELY(static_cast(idx) > parent.size())) + if (HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) { // avoid undefined behavior JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); @@ -20392,7 +21920,7 @@ class basic_json { // perform range check auto it = parent.find(last_path); - if (JSON_LIKELY(it != parent.end())) + if (HEDLEY_LIKELY(it != parent.end())) { parent.erase(it); } @@ -20409,7 +21937,7 @@ class basic_json }; // type check: top level value must be an array - if (JSON_UNLIKELY(not json_patch.is_array())) + if (HEDLEY_UNLIKELY(not json_patch.is_array())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -20429,13 +21957,13 @@ class basic_json const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; // check if desired value is present - if (JSON_UNLIKELY(it == val.m_value.object->end())) + if (HEDLEY_UNLIKELY(it == val.m_value.object->end())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); } // check if result is of type string - if (JSON_UNLIKELY(string_type and not it->second.is_string())) + if (HEDLEY_UNLIKELY(string_type and not it->second.is_string())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); } @@ -20445,7 +21973,7 @@ class basic_json }; // type check: every element of the array must be an object - if (JSON_UNLIKELY(not val.is_object())) + if (HEDLEY_UNLIKELY(not val.is_object())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -20523,7 +22051,7 @@ class basic_json } // throw an exception if test fails - if (JSON_UNLIKELY(not success)) + if (HEDLEY_UNLIKELY(not success)) { JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); } @@ -20576,7 +22104,7 @@ class basic_json @since version 2.0.0 */ - JSON_NODISCARD + HEDLEY_WARN_UNUSED_RESULT static basic_json diff(const basic_json& source, const basic_json& target, const std::string& path = "") { @@ -20868,6 +22396,7 @@ if no parse error occurred. @since version 1.0.0 */ +HEDLEY_NON_NULL(1) inline nlohmann::json operator "" _json(const char* s, std::size_t n) { return nlohmann::json::parse(s, s + n); @@ -20886,6 +22415,7 @@ object if no parse error occurred. @since version 2.0.0 */ +HEDLEY_NON_NULL(1) inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) { return nlohmann::json::json_pointer(std::string(s, n)); @@ -20907,10 +22437,6 @@ inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std #undef JSON_CATCH #undef JSON_THROW #undef JSON_TRY -#undef JSON_LIKELY -#undef JSON_UNLIKELY -#undef JSON_DEPRECATED -#undef JSON_NODISCARD #undef JSON_HAS_CPP_14 #undef JSON_HAS_CPP_17 #undef NLOHMANN_BASIC_JSON_TPL_DECLARATION From 897362191d7618d2210c4395ff7984d4932672f5 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Mon, 1 Jul 2019 22:24:39 +0200 Subject: [PATCH 2/7] :hammer: add NLOHMANN_JSON prefix and undef macros --- Makefile | 7 + hedley.h | 1505 ++++++++++ .../nlohmann/detail/conversions/from_json.hpp | 24 +- .../nlohmann/detail/conversions/to_chars.hpp | 16 +- include/nlohmann/detail/exceptions.hpp | 12 +- .../nlohmann/detail/input/binary_reader.hpp | 116 +- .../nlohmann/detail/input/input_adapters.hpp | 10 +- include/nlohmann/detail/input/json_sax.hpp | 10 +- include/nlohmann/detail/input/lexer.hpp | 44 +- include/nlohmann/detail/input/parser.hpp | 48 +- .../nlohmann/detail/iterators/iter_impl.hpp | 12 +- include/nlohmann/detail/json_pointer.hpp | 34 +- include/nlohmann/detail/macro_unscope.hpp | 2 + .../nlohmann/detail/output/binary_writer.hpp | 2 +- .../detail/output/output_adapters.hpp | 6 +- include/nlohmann/detail/output/serializer.hpp | 6 +- include/nlohmann/json.hpp | 174 +- include/nlohmann/thirdparty/hedley/hedley.hpp | 1780 ++++++------ .../thirdparty/hedley/hedley_undef.hpp | 122 + single_include/nlohmann/json.hpp | 2419 +++++++++-------- 20 files changed, 4055 insertions(+), 2294 deletions(-) create mode 100644 hedley.h create mode 100644 include/nlohmann/thirdparty/hedley/hedley_undef.hpp diff --git a/Makefile b/Makefile index 3afca525..141e1c78 100644 --- a/Makefile +++ b/Makefile @@ -616,3 +616,10 @@ clean: rm -fr build_coverage build_benchmarks fuzz-testing clang_analyze_build pvs_studio_build infer_build clang_sanitize_build cmake_build $(MAKE) clean -Cdoc $(MAKE) clean -Ctest + +update_hedley: + rm -f include/nlohmann/thirdparty/hedley/hedley.hpp include/nlohmann/thirdparty/hedley/hedley_undef.hpp + curl https://raw.githubusercontent.com/nemequ/hedley/master/hedley.h -o include/nlohmann/thirdparty/hedley/hedley.hpp + gsed -i 's/HEDLEY_/NLOHMANN_JSON_HEDLEY_/g' include/nlohmann/thirdparty/hedley/hedley.hpp + grep "[[:blank:]]*#[[:blank:]]*undef" include/nlohmann/thirdparty/hedley/hedley.hpp | sort | uniq | gsed 's/ //g' | gsed 's/undef/undef /g' > include/nlohmann/thirdparty/hedley/hedley_undef.hpp + $(MAKE) amalgamate diff --git a/hedley.h b/hedley.h new file mode 100644 index 00000000..d20c2297 --- /dev/null +++ b/hedley.h @@ -0,0 +1,1505 @@ +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + * + * To the extent possible under law, the author(s) have dedicated all + * copyright and related and neighboring rights to this software to + * the public domain worldwide. This software is distributed without + * any warranty. + * + * For details, see . + * SPDX-License-Identifier: CC0-1.0 + */ + +#if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 9) +#if defined(HEDLEY_VERSION) +# undef HEDLEY_VERSION +#endif +#define HEDLEY_VERSION 9 + +#if defined(HEDLEY_STRINGIFY_EX) +# undef HEDLEY_STRINGIFY_EX +#endif +#define HEDLEY_STRINGIFY_EX(x) #x + +#if defined(HEDLEY_STRINGIFY) +# undef HEDLEY_STRINGIFY +#endif +#define HEDLEY_STRINGIFY(x) HEDLEY_STRINGIFY_EX(x) + +#if defined(HEDLEY_CONCAT_EX) +# undef HEDLEY_CONCAT_EX +#endif +#define HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(HEDLEY_CONCAT) +# undef HEDLEY_CONCAT +#endif +#define HEDLEY_CONCAT(a,b) HEDLEY_CONCAT_EX(a,b) + +#if defined(HEDLEY_VERSION_ENCODE) +# undef HEDLEY_VERSION_ENCODE +#endif +#define HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(HEDLEY_VERSION_DECODE_MAJOR) +# undef HEDLEY_VERSION_DECODE_MAJOR +#endif +#define HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(HEDLEY_VERSION_DECODE_MINOR) +# undef HEDLEY_VERSION_DECODE_MINOR +#endif +#define HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(HEDLEY_VERSION_DECODE_REVISION) +# undef HEDLEY_VERSION_DECODE_REVISION +#endif +#define HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(HEDLEY_GNUC_VERSION) +# undef HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) +# define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) +# define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(HEDLEY_GNUC_VERSION_CHECK) +# undef HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(HEDLEY_GNUC_VERSION) +# define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (HEDLEY_GNUC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_MSVC_VERSION) +# undef HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) +# define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) +# define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) +# define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(HEDLEY_MSVC_VERSION_CHECK) +# undef HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(_MSC_VER) +# define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) +# define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) +# define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else +# define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(HEDLEY_INTEL_VERSION) +# undef HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) +# define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) +# define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(HEDLEY_INTEL_VERSION_CHECK) +# undef HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(HEDLEY_INTEL_VERSION) +# define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (HEDLEY_INTEL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_PGI_VERSION) +# undef HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) +# define HEDLEY_PGI_VERSION HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(HEDLEY_PGI_VERSION_CHECK) +# undef HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(HEDLEY_PGI_VERSION) +# define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (HEDLEY_PGI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_SUNPRO_VERSION) +# undef HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) +# define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) +# define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) +# define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) +# define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(HEDLEY_SUNPRO_VERSION_CHECK) +# undef HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(HEDLEY_SUNPRO_VERSION) +# define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (HEDLEY_SUNPRO_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_EMSCRIPTEN_VERSION) +# undef HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) +# define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(HEDLEY_EMSCRIPTEN_VERSION_CHECK) +# undef HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(HEDLEY_EMSCRIPTEN_VERSION) +# define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (HEDLEY_EMSCRIPTEN_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_ARM_VERSION) +# undef HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) +# define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) +# define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(HEDLEY_ARM_VERSION_CHECK) +# undef HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(HEDLEY_ARM_VERSION) +# define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (HEDLEY_ARM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_IBM_VERSION) +# undef HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) +# define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) +# define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) +# define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(HEDLEY_IBM_VERSION_CHECK) +# undef HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(HEDLEY_IBM_VERSION) +# define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (HEDLEY_IBM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_TI_VERSION) +# undef HEDLEY_TI_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) +# define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(HEDLEY_TI_VERSION_CHECK) +# undef HEDLEY_TI_VERSION_CHECK +#endif +#if defined(HEDLEY_TI_VERSION) +# define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_CRAY_VERSION) +# undef HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) +# if defined(_RELEASE_PATCHLEVEL) +# define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) +# else +# define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) +# endif +#endif + +#if defined(HEDLEY_CRAY_VERSION_CHECK) +# undef HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(HEDLEY_CRAY_VERSION) +# define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (HEDLEY_CRAY_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_IAR_VERSION) +# undef HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) +# if __VER__ > 1000 +# define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) +# else +# define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) +# endif +#endif + +#if defined(HEDLEY_IAR_VERSION_CHECK) +# undef HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(HEDLEY_IAR_VERSION) +# define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (HEDLEY_IAR_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_TINYC_VERSION) +# undef HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) +# define HEDLEY_TINYC_VERSION HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(HEDLEY_TINYC_VERSION_CHECK) +# undef HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(HEDLEY_TINYC_VERSION) +# define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (HEDLEY_TINYC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_DMC_VERSION) +# undef HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) +# define HEDLEY_DMC_VERSION HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(HEDLEY_DMC_VERSION_CHECK) +# undef HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(HEDLEY_DMC_VERSION) +# define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (HEDLEY_DMC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_COMPCERT_VERSION) +# undef HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) +# define HEDLEY_COMPCERT_VERSION HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(HEDLEY_COMPCERT_VERSION_CHECK) +# undef HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(HEDLEY_COMPCERT_VERSION) +# define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (HEDLEY_COMPCERT_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_PELLES_VERSION) +# undef HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) +# define HEDLEY_PELLES_VERSION HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(HEDLEY_PELLES_VERSION_CHECK) +# undef HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(HEDLEY_PELLES_VERSION) +# define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (HEDLEY_PELLES_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_GCC_VERSION) +# undef HEDLEY_GCC_VERSION +#endif +#if \ + defined(HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(HEDLEY_INTEL_VERSION) && \ + !defined(HEDLEY_PGI_VERSION) && \ + !defined(HEDLEY_ARM_VERSION) && \ + !defined(HEDLEY_TI_VERSION) && \ + !defined(__COMPCERT__) +# define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION +#endif + +#if defined(HEDLEY_GCC_VERSION_CHECK) +# undef HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(HEDLEY_GCC_VERSION) +# define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (HEDLEY_GCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else +# define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(HEDLEY_HAS_ATTRIBUTE) +# undef HEDLEY_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) +# define HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else +# define HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_ATTRIBUTE) +# undef HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) +# define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else +# define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_ATTRIBUTE) +# undef HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) +# define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else +# define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_CPP_ATTRIBUTE) +# undef HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) +# define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else +# define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) +# undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) +# define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else +# define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_CPP_ATTRIBUTE) +# undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) +# define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else +# define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_BUILTIN) +# undef HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) +# define HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else +# define HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_BUILTIN) +# undef HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) +# define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else +# define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_BUILTIN) +# undef HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) +# define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else +# define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_FEATURE) +# undef HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) +# define HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else +# define HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_FEATURE) +# undef HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) +# define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else +# define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_FEATURE) +# undef HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) +# define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else +# define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_EXTENSION) +# undef HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) +# define HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else +# define HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_EXTENSION) +# undef HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) +# define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else +# define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_EXTENSION) +# undef HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) +# define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else +# define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_DECLSPEC_ATTRIBUTE) +# undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) +# define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else +# define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) +# undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) +# define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else +# define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) +# undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) +# define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else +# define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_HAS_WARNING) +# undef HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) +# define HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else +# define HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(HEDLEY_GNUC_HAS_WARNING) +# undef HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) +# define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else +# define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_GCC_HAS_WARNING) +# undef HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) +# define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else +# define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,0,0) || \ + HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) +# define HEDLEY_PRAGMA(value) _Pragma(#value) +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define HEDLEY_PRAGMA(value) __pragma(value) +#else +# define HEDLEY_PRAGMA(value) +#endif + +#if defined(HEDLEY_DIAGNOSTIC_PUSH) +# undef HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(HEDLEY_DIAGNOSTIC_POP) +# undef HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) +# define HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") +# define HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") +# define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif HEDLEY_GCC_VERSION_CHECK(4,6,0) +# define HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") +# define HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) +# define HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif HEDLEY_ARM_VERSION_CHECK(5,6,0) +# define HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") +# define HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif HEDLEY_TI_VERSION_CHECK(8,1,0) +# define HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") +# define HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) +# define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") +# define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else +# define HEDLEY_DIAGNOSTIC_PUSH +# define HEDLEY_DIAGNOSTIC_POP +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) +# undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if HEDLEY_HAS_WARNING("-Wdeprecated-declarations") +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif HEDLEY_TI_VERSION_CHECK(8,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else +# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) +# undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif HEDLEY_TI_VERSION_CHECK(8,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#else +# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) +# undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if HEDLEY_HAS_WARNING("-Wcast-qual") +# define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif HEDLEY_GCC_VERSION_CHECK(3,0,0) +# define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else +# define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(HEDLEY_DEPRECATED) +# undef HEDLEY_DEPRECATED +#endif +#if defined(HEDLEY_DEPRECATED_FOR) +# undef HEDLEY_DEPRECATED_FOR +#endif +#if defined(__cplusplus) && (__cplusplus >= 201402L) +# define HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] +# define HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] +#elif \ + HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + HEDLEY_TI_VERSION_CHECK(8,3,0) +# define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) +# define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif \ + HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) +# define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) +# define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif HEDLEY_MSVC_VERSION_CHECK(14,0,0) +# define HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) +# define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + HEDLEY_PELLES_VERSION_CHECK(6,50,0) +# define HEDLEY_DEPRECATED(since) _declspec(deprecated) +# define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_DEPRECATED(since) _Pragma("deprecated") +# define HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else +# define HEDLEY_DEPRECATED(since) +# define HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(HEDLEY_UNAVAILABLE) +# undef HEDLEY_UNAVAILABLE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(warning) || \ + HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else +# define HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(HEDLEY_WARN_UNUSED_RESULT) +# undef HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(__cplusplus) && (__cplusplus >= 201703L) +# define HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] +#elif \ + HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) +# define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) +#elif defined(_Check_return_) /* SAL */ +# define HEDLEY_WARN_UNUSED_RESULT _Check_return_ +#else +# define HEDLEY_WARN_UNUSED_RESULT +#endif + +#if defined(HEDLEY_SENTINEL) +# undef HEDLEY_SENTINEL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,4,0) +# define HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else +# define HEDLEY_SENTINEL(position) +#endif + +#if defined(HEDLEY_NO_RETURN) +# undef HEDLEY_NO_RETURN +#endif +#if HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_NO_RETURN __noreturn +#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# define HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) +# define HEDLEY_NO_RETURN [[noreturn]] +#elif \ + HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(18,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) +# define HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) +# define HEDLEY_NO_RETURN __declspec(noreturn) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) +# define HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) +# define HEDLEY_NO_RETURN __attribute((noreturn)) +#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) +# define HEDLEY_NO_RETURN __declspec(noreturn) +#else +# define HEDLEY_NO_RETURN +#endif + +#if defined(HEDLEY_UNREACHABLE) +# undef HEDLEY_UNREACHABLE +#endif +#if defined(HEDLEY_UNREACHABLE_RETURN) +# undef HEDLEY_UNREACHABLE_RETURN +#endif +#if \ + (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,5) +# define HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) +# define HEDLEY_UNREACHABLE() __assume(0) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) +# if defined(__cplusplus) +# define HEDLEY_UNREACHABLE() std::_nassert(0) +# else +# define HEDLEY_UNREACHABLE() _nassert(0) +# endif +# define HEDLEY_UNREACHABLE_RETURN(value) return value +#elif defined(EXIT_FAILURE) +# define HEDLEY_UNREACHABLE() abort() +#else +# define HEDLEY_UNREACHABLE() +# define HEDLEY_UNREACHABLE_RETURN(value) return value +#endif +#if !defined(HEDLEY_UNREACHABLE_RETURN) +# define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE() +#endif + +#if defined(HEDLEY_ASSUME) +# undef HEDLEY_ASSUME +#endif +#if \ + HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_ASSUME(expr) __assume(expr) +#elif HEDLEY_HAS_BUILTIN(__builtin_assume) +# define HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) +# if defined(__cplusplus) +# define HEDLEY_ASSUME(expr) std::_nassert(expr) +# else +# define HEDLEY_ASSUME(expr) _nassert(expr) +# endif +#elif \ + (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(HEDLEY_ARM_VERSION)) || \ + HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,5) +# define HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) +#else +# define HEDLEY_ASSUME(expr) ((void) (expr)) +#endif + + +HEDLEY_DIAGNOSTIC_PUSH +#if \ + HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) +# if defined(__clang__) +# pragma clang diagnostic ignored "-Wvariadic-macros" +# elif defined(HEDLEY_GCC_VERSION) +# pragma GCC diagnostic ignored "-Wvariadic-macros" +# endif +#endif +#if defined(HEDLEY_NON_NULL) +# undef HEDLEY_NON_NULL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) +# define HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else +# define HEDLEY_NON_NULL(...) +#endif +HEDLEY_DIAGNOSTIC_POP + +#if defined(HEDLEY_PRINTF_FORMAT) +# undef HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) +# define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) +# define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + HEDLEY_HAS_ATTRIBUTE(format) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) +# define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif HEDLEY_PELLES_VERSION_CHECK(6,0,0) +# define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else +# define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(HEDLEY_CONSTEXPR) +# undef HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) +# if __cplusplus >= 201103L +# define HEDLEY_CONSTEXPR constexpr +# endif +#endif +#if !defined(HEDLEY_CONSTEXPR) +# define HEDLEY_CONSTEXPR +#endif + +#if defined(HEDLEY_PREDICT) +# undef HEDLEY_PREDICT +#endif +#if defined(HEDLEY_LIKELY) +# undef HEDLEY_LIKELY +#endif +#if defined(HEDLEY_UNLIKELY) +# undef HEDLEY_UNLIKELY +#endif +#if defined(HEDLEY_UNPREDICTABLE) +# undef HEDLEY_UNPREDICTABLE +#endif +#if HEDLEY_HAS_BUILTIN(__builtin_unpredictable) +# define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) +#endif +#if \ + HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) +# define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) +# define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) +# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +# if !defined(HEDLEY_BUILTIN_UNPREDICTABLE) +# define HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) +# endif +#elif \ + HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,27) +# define HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void) (expected)), !!(expr))) +# define HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) +# define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define HEDLEY_LIKELY(expr) (!!(expr)) +# define HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(HEDLEY_UNPREDICTABLE) +# define HEDLEY_UNPREDICTABLE(expr) HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(HEDLEY_MALLOC) +# undef HEDLEY_MALLOC +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(malloc) || \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) +# define HEDLEY_MALLOC __attribute__((__malloc__)) +#elif HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) +# define HEDLEY_MALLOC __declspec(restrict) +#else +# define HEDLEY_MALLOC +#endif + +#if defined(HEDLEY_PURE) +# undef HEDLEY_PURE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(pure) || \ + HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) +# define HEDLEY_PURE __attribute__((__pure__)) +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) +# define HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define HEDLEY_PURE +#endif + +#if defined(HEDLEY_CONST) +# undef HEDLEY_CONST +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(const) || \ + HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) +# define HEDLEY_CONST __attribute__((__const__)) +#else +# define HEDLEY_CONST HEDLEY_PURE +#endif + +#if defined(HEDLEY_RESTRICT) +# undef HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) +# define HEDLEY_RESTRICT restrict +#elif \ + HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) +# define HEDLEY_RESTRICT __restrict +#elif HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) +# define HEDLEY_RESTRICT _Restrict +#else +# define HEDLEY_RESTRICT +#endif + +#if defined(HEDLEY_INLINE) +# undef HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) +# define HEDLEY_INLINE inline +#elif \ + defined(HEDLEY_GCC_VERSION) || \ + HEDLEY_ARM_VERSION_CHECK(6,2,0) +# define HEDLEY_INLINE __inline__ +#elif \ + HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) +# define HEDLEY_INLINE __inline +#else +# define HEDLEY_INLINE +#endif + +#if defined(HEDLEY_ALWAYS_INLINE) +# undef HEDLEY_ALWAYS_INLINE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) +# define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE +#elif HEDLEY_MSVC_VERSION_CHECK(12,0,0) +# define HEDLEY_ALWAYS_INLINE __forceinline +#elif HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) +# define HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE +#endif + +#if defined(HEDLEY_NEVER_INLINE) +# undef HEDLEY_NEVER_INLINE +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(noinline) || \ + HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) +# define HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) +# define HEDLEY_NEVER_INLINE __declspec(noinline) +#elif HEDLEY_PGI_VERSION_CHECK(10,2,0) +# define HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) +# define HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) +# define HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) +# define HEDLEY_NEVER_INLINE __declspec(noinline) +#else +# define HEDLEY_NEVER_INLINE +#endif + +#if defined(HEDLEY_PRIVATE) +# undef HEDLEY_PRIVATE +#endif +#if defined(HEDLEY_PUBLIC) +# undef HEDLEY_PUBLIC +#endif +#if defined(HEDLEY_IMPORT) +# undef HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define HEDLEY_PRIVATE +# define HEDLEY_PUBLIC __declspec(dllexport) +# define HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + HEDLEY_HAS_ATTRIBUTE(visibility) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) +# define HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define HEDLEY_PRIVATE +# define HEDLEY_PUBLIC +# endif +# define HEDLEY_IMPORT extern +#endif + +#if defined(HEDLEY_NO_THROW) +# undef HEDLEY_NO_THROW +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) +# define HEDLEY_NO_THROW __declspec(nothrow) +#else +# define HEDLEY_NO_THROW +#endif + +#if defined(HEDLEY_FALL_THROUGH) +# undef HEDLEY_FALL_THROUGH +#endif +#if \ + defined(__cplusplus) && \ + (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + !defined(HEDLEY_PGI_VERSION) +# if \ + (__cplusplus >= 201703L) || \ + ((__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) +# define HEDLEY_FALL_THROUGH [[fallthrough]] +# elif (__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) +# define HEDLEY_FALL_THROUGH [[clang::fallthrough]] +# elif (__cplusplus >= 201103L) && HEDLEY_GCC_VERSION_CHECK(7,0,0) +# define HEDLEY_FALL_THROUGH [[gnu::fallthrough]] +# endif +#endif +#if !defined(HEDLEY_FALL_THROUGH) +# if HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(HEDLEY_PGI_VERSION) +# define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +# elif defined(__fallthrough) /* SAL */ +# define HEDLEY_FALL_THROUGH __fallthrough +# else +# define HEDLEY_FALL_THROUGH +# endif +#endif + +#if defined(HEDLEY_RETURNS_NON_NULL) +# undef HEDLEY_RETURNS_NON_NULL +#endif +#if \ + HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + HEDLEY_GCC_VERSION_CHECK(4,9,0) +# define HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ +# define HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else +# define HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(HEDLEY_ARRAY_PARAM) +# undef HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(HEDLEY_PGI_VERSION) && \ + !defined(HEDLEY_TINYC_VERSION) +# define HEDLEY_ARRAY_PARAM(name) (name) +#else +# define HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(HEDLEY_IS_CONSTANT) +# undef HEDLEY_IS_CONSTANT +#endif +#if defined(HEDLEY_REQUIRE_CONSTEXPR) +# undef HEDLEY_REQUIRE_CONSTEXPR +#endif +/* Note the double-underscore. For internal use only; no API + * guarantees! */ +#if defined(HEDLEY__IS_CONSTEXPR) +# undef HEDLEY__IS_CONSTEXPR +#endif + +#if \ + HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ + HEDLEY_CRAY_VERSION_CHECK(8,1,0) +# define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + HEDLEY_TINYC_VERSION_CHECK(0,9,24) +# if defined(__INTPTR_TYPE__) +# define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +# else +# include +# define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +# endif +# elif \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(HEDLEY_SUNPRO_VERSION) && !defined(HEDLEY_PGI_VERSION)) || \ + HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + HEDLEY_ARM_VERSION_CHECK(5,3,0) +# if defined(__INTPTR_TYPE__) +# define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +# else +# include +# define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +# endif +# elif \ + defined(HEDLEY_GCC_VERSION) || \ + defined(HEDLEY_INTEL_VERSION) || \ + defined(HEDLEY_TINYC_VERSION) || \ + defined(HEDLEY_TI_VERSION) || \ + defined(__clang__) +# define HEDLEY__IS_CONSTEXPR(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ + ((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(HEDLEY__IS_CONSTEXPR) +# if !defined(HEDLEY_IS_CONSTANT) +# define HEDLEY_IS_CONSTANT(expr) HEDLEY__IS_CONSTEXPR(expr) +# endif +# define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) +#else +# if !defined(HEDLEY_IS_CONSTANT) +# define HEDLEY_IS_CONSTANT(expr) (0) +# endif +# define HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(HEDLEY_BEGIN_C_DECLS) +# undef HEDLEY_BEGIN_C_DECLS +#endif +#if defined(HEDLEY_END_C_DECLS) +# undef HEDLEY_END_C_DECLS +#endif +#if defined(HEDLEY_C_DECL) +# undef HEDLEY_C_DECL +#endif +#if defined(__cplusplus) +# define HEDLEY_BEGIN_C_DECLS extern "C" { +# define HEDLEY_END_C_DECLS } +# define HEDLEY_C_DECL extern "C" +#else +# define HEDLEY_BEGIN_C_DECLS +# define HEDLEY_END_C_DECLS +# define HEDLEY_C_DECL +#endif + +#if defined(HEDLEY_STATIC_ASSERT) +# undef HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + HEDLEY_HAS_FEATURE(c_static_assert) || \ + HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ + HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + (defined(__cplusplus) && HEDLEY_TI_VERSION_CHECK(8,3,0)) +# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) +#elif defined(__cplusplus) && (__cplusplus >= 201103L) +# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) +#else +# define HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(HEDLEY_CONST_CAST) +# undef HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + HEDLEY_HAS_WARNING("-Wcast-qual") || \ + HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(HEDLEY_REINTERPRET_CAST) +# undef HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) +# define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else +# define HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) +#endif + +#if defined(HEDLEY_STATIC_CAST) +# undef HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) +# define HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else +# define HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(HEDLEY_CPP_CAST) +# undef HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# define HEDLEY_CPP_CAST(T, expr) static_cast(expr) +#else +# define HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(HEDLEY_MESSAGE) +# undef HEDLEY_MESSAGE +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define HEDLEY_MESSAGE(msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + HEDLEY_PRAGMA(message msg) \ + HEDLEY_DIAGNOSTIC_POP +#elif \ + HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message msg) +#elif HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(_CRI message msg) +#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) +#elif HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) +#else +# define HEDLEY_MESSAGE(msg) +#endif + +#if defined(HEDLEY_WARNING) +# undef HEDLEY_WARNING +#endif +#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define HEDLEY_WARNING(msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + HEDLEY_PRAGMA(clang warning msg) \ + HEDLEY_DIAGNOSTIC_POP +#elif \ + HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + HEDLEY_PGI_VERSION_CHECK(18,4,0) +# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg) +#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg)) +#else +# define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg) +#endif + +#if defined(HEDLEY_REQUIRE_MSG) +# undef HEDLEY_REQUIRE_MSG +#endif +#if HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if HEDLEY_HAS_WARNING("-Wgcc-compat") +# define HEDLEY_REQUIRE_MSG(expr, msg) \ + HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((__diagnose_if__(!(expr), msg, "error"))) \ + HEDLEY_DIAGNOSTIC_POP +# else +# define HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) +# endif +#else +# define HEDLEY_REQUIRE_MSG(expr, msg) +#endif + +#if defined(HEDLEY_REQUIRE) +# undef HEDLEY_REQUIRE +#endif +#define HEDLEY_REQUIRE(expr) HEDLEY_REQUIRE_MSG(expr, #expr) + +#if defined(HEDLEY_FLAGS) +# undef HEDLEY_FLAGS +#endif +#if HEDLEY_HAS_ATTRIBUTE(flag_enum) +# define HEDLEY_FLAGS __attribute__((__flag_enum__)) +#endif + +#if defined(HEDLEY_FLAGS_CAST) +# undef HEDLEY_FLAGS_CAST +#endif +#if HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define HEDLEY_FLAGS_CAST(T, expr) HEDLEY_STATIC_CAST(T, expr) +#endif + +/* Remaining macros are deprecated. */ + +#if defined(HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) +# undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) +# define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else +# define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(HEDLEY_CLANG_HAS_ATTRIBUTE) +# undef HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) +# undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_BUILTIN) +# undef HEDLEY_CLANG_HAS_BUILTIN +#endif +#define HEDLEY_CLANG_HAS_BUILTIN(builtin) HEDLEY_HAS_BUILTIN(builtin) + +#if defined(HEDLEY_CLANG_HAS_FEATURE) +# undef HEDLEY_CLANG_HAS_FEATURE +#endif +#define HEDLEY_CLANG_HAS_FEATURE(feature) HEDLEY_HAS_FEATURE(feature) + +#if defined(HEDLEY_CLANG_HAS_EXTENSION) +# undef HEDLEY_CLANG_HAS_EXTENSION +#endif +#define HEDLEY_CLANG_HAS_EXTENSION(extension) HEDLEY_HAS_EXTENSION(extension) + +#if defined(HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) +# undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(HEDLEY_CLANG_HAS_WARNING) +# undef HEDLEY_CLANG_HAS_WARNING +#endif +#define HEDLEY_CLANG_HAS_WARNING(warning) HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */ diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index b7848c9e..4520041e 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -26,7 +26,7 @@ namespace detail template void from_json(const BasicJsonType& j, typename std::nullptr_t& n) { - if (HEDLEY_UNLIKELY(not j.is_null())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_null())) { JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); } @@ -66,7 +66,7 @@ void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) template void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) { - if (HEDLEY_UNLIKELY(not j.is_boolean())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_boolean())) { JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); } @@ -76,7 +76,7 @@ void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) template void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) { - if (HEDLEY_UNLIKELY(not j.is_string())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -92,7 +92,7 @@ template < int > = 0 > void from_json(const BasicJsonType& j, ConstructibleStringType& s) { - if (HEDLEY_UNLIKELY(not j.is_string())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -132,7 +132,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::forward_list& l) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -149,7 +149,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::valarray& l) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -236,7 +236,7 @@ auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) j.template get(), void()) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); @@ -249,7 +249,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) { - if (HEDLEY_UNLIKELY(not j.is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); } @@ -332,14 +332,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::map& m) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (HEDLEY_UNLIKELY(not p.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -352,14 +352,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::unordered_map& m) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (HEDLEY_UNLIKELY(not p.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } diff --git a/include/nlohmann/detail/conversions/to_chars.hpp b/include/nlohmann/detail/conversions/to_chars.hpp index 6edc57ff..9a88937e 100644 --- a/include/nlohmann/detail/conversions/to_chars.hpp +++ b/include/nlohmann/detail/conversions/to_chars.hpp @@ -819,7 +819,7 @@ v = buf * 10^decimal_exponent len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ -HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_NON_NULL(1) inline void grisu2(char* buf, int& len, int& decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) { @@ -879,7 +879,7 @@ len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ template -HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_NON_NULL(1) void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) { static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, @@ -918,8 +918,8 @@ void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) @return a pointer to the element following the exponent. @pre -1000 < e < 1000 */ -HEDLEY_NON_NULL(1) -HEDLEY_RETURNS_NON_NULL +NLOHMANN_JSON_HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL inline char* append_exponent(char* buf, int e) { assert(e > -1000); @@ -970,8 +970,8 @@ notation. Otherwise it will be printed in exponential notation. @pre min_exp < 0 @pre max_exp > 0 */ -HEDLEY_NON_NULL(1) -HEDLEY_RETURNS_NON_NULL +NLOHMANN_JSON_HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL inline char* format_buffer(char* buf, int len, int decimal_exponent, int min_exp, int max_exp) { @@ -1055,8 +1055,8 @@ format. Returns an iterator pointing past-the-end of the decimal representation. @note The result is NOT null-terminated. */ template -HEDLEY_NON_NULL(1, 2) -HEDLEY_RETURNS_NON_NULL +NLOHMANN_JSON_HEDLEY_NON_NULL(1, 2) +NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL char* to_chars(char* first, const char* last, FloatType value) { static_cast(last); // maybe unused - fix warning diff --git a/include/nlohmann/detail/exceptions.hpp b/include/nlohmann/detail/exceptions.hpp index bff13194..ad9673b6 100644 --- a/include/nlohmann/detail/exceptions.hpp +++ b/include/nlohmann/detail/exceptions.hpp @@ -47,7 +47,7 @@ class exception : public std::exception { public: /// returns the explanatory string - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL const char* what() const noexcept override { return m.what(); @@ -57,7 +57,7 @@ class exception : public std::exception const int id; protected: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} static std::string name(const std::string& ename, int id_) @@ -210,7 +210,7 @@ class invalid_iterator : public exception } private: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) invalid_iterator(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -264,7 +264,7 @@ class type_error : public exception } private: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -311,7 +311,7 @@ class out_of_range : public exception } private: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -349,7 +349,7 @@ class other_error : public exception } private: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; } // namespace detail diff --git a/include/nlohmann/detail/input/binary_reader.hpp b/include/nlohmann/detail/input/binary_reader.hpp index 33af9c36..48ad8c00 100644 --- a/include/nlohmann/detail/input/binary_reader.hpp +++ b/include/nlohmann/detail/input/binary_reader.hpp @@ -66,7 +66,7 @@ class binary_reader @return */ - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) bool sax_parse(const input_format_t format, json_sax_t* sax_, const bool strict = true) @@ -108,7 +108,7 @@ class binary_reader get(); } - if (HEDLEY_UNLIKELY(current != std::char_traits::eof())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current != std::char_traits::eof())) { return sax->parse_error(chars_read, get_token_string(), parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); @@ -144,12 +144,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } - if (HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) { return false; } @@ -170,7 +170,7 @@ class binary_reader while (true) { get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) { return false; } @@ -198,7 +198,7 @@ class binary_reader template bool get_bson_string(const NumberType len, string_t& result) { - if (HEDLEY_UNLIKELY(len < 1)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len < 1)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); @@ -293,13 +293,13 @@ class binary_reader string_t key; while (int element_type = get()) { - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) { return false; } const std::size_t element_type_parse_position = chars_read; - if (HEDLEY_UNLIKELY(not get_bson_cstr(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_bson_cstr(key))) { return false; } @@ -309,7 +309,7 @@ class binary_reader return false; } - if (HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) { return false; } @@ -330,12 +330,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } - if (HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) { return false; } @@ -620,12 +620,12 @@ class binary_reader case 0xF9: // Half-Precision Float (two-byte IEEE 754) { const int byte1_raw = get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } const int byte2_raw = get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } @@ -698,7 +698,7 @@ class binary_reader */ bool get_cbor_string(string_t& result) { - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) { return false; } @@ -787,7 +787,7 @@ class binary_reader */ bool get_cbor_array(const std::size_t len) { - if (HEDLEY_UNLIKELY(not sax->start_array(len))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } @@ -796,7 +796,7 @@ class binary_reader { for (std::size_t i = 0; i < len; ++i) { - if (HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -806,7 +806,7 @@ class binary_reader { while (get() != 0xFF) { - if (HEDLEY_UNLIKELY(not parse_cbor_internal(false))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal(false))) { return false; } @@ -823,7 +823,7 @@ class binary_reader */ bool get_cbor_object(const std::size_t len) { - if (HEDLEY_UNLIKELY(not sax->start_object(len))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -834,12 +834,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -850,12 +850,12 @@ class binary_reader { while (get() != 0xFF) { - if (HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -1244,7 +1244,7 @@ class binary_reader */ bool get_msgpack_string(string_t& result) { - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) { return false; } @@ -1320,14 +1320,14 @@ class binary_reader */ bool get_msgpack_array(const std::size_t len) { - if (HEDLEY_UNLIKELY(not sax->start_array(len))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } for (std::size_t i = 0; i < len; ++i) { - if (HEDLEY_UNLIKELY(not parse_msgpack_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -1342,7 +1342,7 @@ class binary_reader */ bool get_msgpack_object(const std::size_t len) { - if (HEDLEY_UNLIKELY(not sax->start_object(len))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -1351,12 +1351,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_msgpack_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -1403,7 +1403,7 @@ class binary_reader get(); // TODO(niels): may we ignore N here? } - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -1457,7 +1457,7 @@ class binary_reader case 'U': { std::uint8_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1468,7 +1468,7 @@ class binary_reader case 'i': { std::int8_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1479,7 +1479,7 @@ class binary_reader case 'I': { std::int16_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1490,7 +1490,7 @@ class binary_reader case 'l': { std::int32_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1501,7 +1501,7 @@ class binary_reader case 'L': { std::int64_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1537,15 +1537,15 @@ class binary_reader if (current == '$') { result.second = get(); // must not ignore 'N', because 'N' maybe the type - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) { return false; } get_ignore_noop(); - if (HEDLEY_UNLIKELY(current != '#')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current != '#')) { - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -1628,11 +1628,11 @@ class binary_reader case 'C': // char { get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) { return false; } - if (HEDLEY_UNLIKELY(current > 127)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current > 127)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); @@ -1667,14 +1667,14 @@ class binary_reader bool get_ubjson_array() { std::pair size_and_type; - if (HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } if (size_and_type.first != string_t::npos) { - if (HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) { return false; } @@ -1685,7 +1685,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -1696,7 +1696,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1705,14 +1705,14 @@ class binary_reader } else { - if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } while (current != ']') { - if (HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) { return false; } @@ -1729,7 +1729,7 @@ class binary_reader bool get_ubjson_object() { std::pair size_and_type; - if (HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } @@ -1737,7 +1737,7 @@ class binary_reader string_t key; if (size_and_type.first != string_t::npos) { - if (HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) { return false; } @@ -1746,11 +1746,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -1761,11 +1761,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1775,18 +1775,18 @@ class binary_reader } else { - if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } while (current != '}') { - if (HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1852,7 +1852,7 @@ class binary_reader for (std::size_t i = 0; i < sizeof(NumberType); ++i) { get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) { return false; } @@ -1896,7 +1896,7 @@ class binary_reader std::generate_n(std::back_inserter(result), len, [this, &success, &format]() { get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) { success = false; } @@ -1910,10 +1910,10 @@ class binary_reader @param[in] context further context information (for diagnostics) @return whether the last read character is not EOF */ - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) bool unexpect_eof(const input_format_t format, const char* context) const { - if (HEDLEY_UNLIKELY(current == std::char_traits::eof())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current == std::char_traits::eof())) { return sax->parse_error(chars_read, "", parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index 487cb525..55b2931c 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -55,7 +55,7 @@ Input adapter for stdio file access. This adapter read only 1 byte and do not us class file_input_adapter : public input_adapter_protocol { public: - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) explicit file_input_adapter(std::FILE* f) noexcept : m_file(f) {} @@ -131,7 +131,7 @@ class input_stream_adapter : public input_adapter_protocol class input_buffer_adapter : public input_adapter_protocol { public: - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) input_buffer_adapter(const char* b, const std::size_t l) noexcept : cursor(b), limit(b + l) {} @@ -145,7 +145,7 @@ class input_buffer_adapter : public input_adapter_protocol std::char_traits::int_type get_character() noexcept override { - if (HEDLEY_LIKELY(cursor < limit)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(cursor < limit)) { return std::char_traits::to_int_type(*(cursor++)); } @@ -335,7 +335,7 @@ class input_adapter { public: // native support - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) input_adapter(std::FILE* file) : ia(std::make_shared(file)) {} /// input adapter for input stream @@ -404,7 +404,7 @@ class input_adapter "each element in the iterator range must have the size of 1 byte"); const auto len = static_cast(std::distance(first, last)); - if (HEDLEY_LIKELY(len > 0)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(len > 0)) { // there is at least one element: use the address of first ia = std::make_shared(reinterpret_cast(&(*first)), len); diff --git a/include/nlohmann/detail/input/json_sax.hpp b/include/nlohmann/detail/input/json_sax.hpp index b4cd1c9b..65e48b31 100644 --- a/include/nlohmann/detail/input/json_sax.hpp +++ b/include/nlohmann/detail/input/json_sax.hpp @@ -206,7 +206,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); - if (HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); @@ -232,7 +232,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); - if (HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); @@ -288,7 +288,7 @@ class json_sax_dom_parser object to which we can add elements */ template - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL BasicJsonType* handle_value(Value&& v) { if (ref_stack.empty()) @@ -395,7 +395,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check object limit - if (ref_stack.back() and HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); } @@ -458,7 +458,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check array limit - if (ref_stack.back() and HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); } diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index 04b9a31e..21e37d4b 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -59,7 +59,7 @@ class lexer }; /// return name of values of type token_type (only used for errors) - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL static const char* token_type_name(const token_type t) noexcept { switch (t) @@ -201,7 +201,7 @@ class lexer for (auto range = ranges.begin(); range != ranges.end(); ++range) { get(); - if (HEDLEY_LIKELY(*range <= current and current <= *(++range))) + if (NLOHMANN_JSON_HEDLEY_LIKELY(*range <= current and current <= *(++range))) { add(current); } @@ -300,7 +300,7 @@ class lexer const int codepoint1 = get_codepoint(); int codepoint = codepoint1; // start with codepoint1 - if (HEDLEY_UNLIKELY(codepoint1 == -1)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; @@ -310,18 +310,18 @@ class lexer if (0xD800 <= codepoint1 and codepoint1 <= 0xDBFF) { // expect next \uxxxx entry - if (HEDLEY_LIKELY(get() == '\\' and get() == 'u')) + if (NLOHMANN_JSON_HEDLEY_LIKELY(get() == '\\' and get() == 'u')) { const int codepoint2 = get_codepoint(); - if (HEDLEY_UNLIKELY(codepoint2 == -1)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; } // check if codepoint2 is a low surrogate - if (HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) { // overwrite codepoint codepoint = static_cast( @@ -348,7 +348,7 @@ class lexer } else { - if (HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) { error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; return token_type::parse_error; @@ -723,7 +723,7 @@ class lexer case 0xDE: case 0xDF: { - if (HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) { return token_type::parse_error; } @@ -733,7 +733,7 @@ class lexer // U+0800..U+0FFF: bytes E0 A0..BF 80..BF case 0xE0: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -757,7 +757,7 @@ class lexer case 0xEE: case 0xEF: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -767,7 +767,7 @@ class lexer // U+D000..U+D7FF: bytes ED 80..9F 80..BF case 0xED: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -777,7 +777,7 @@ class lexer // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF case 0xF0: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -789,7 +789,7 @@ class lexer case 0xF2: case 0xF3: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -799,7 +799,7 @@ class lexer // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF case 0xF4: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -816,19 +816,19 @@ class lexer } } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); @@ -1204,14 +1204,14 @@ scan_number_done: @param[in] length the length of the passed literal text @param[in] return_type the token type to return on success */ - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) token_type scan_literal(const char* literal_text, const std::size_t length, token_type return_type) { assert(current == literal_text[0]); for (std::size_t i = 1; i < length; ++i) { - if (HEDLEY_UNLIKELY(get() != literal_text[i])) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get() != literal_text[i])) { error_message = "invalid literal"; return token_type::parse_error; @@ -1257,7 +1257,7 @@ scan_number_done: current = ia->get_character(); } - if (HEDLEY_LIKELY(current != std::char_traits::eof())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) { token_string.push_back(std::char_traits::to_char_type(current)); } @@ -1298,7 +1298,7 @@ scan_number_done: --position.chars_read_current_line; } - if (HEDLEY_LIKELY(current != std::char_traits::eof())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) { assert(not token_string.empty()); token_string.pop_back(); @@ -1377,7 +1377,7 @@ scan_number_done: } /// return syntax error message - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL constexpr const char* get_error_message() const noexcept { return error_message; diff --git a/include/nlohmann/detail/input/parser.hpp b/include/nlohmann/detail/input/parser.hpp index 55a972e3..2e3f3b62 100644 --- a/include/nlohmann/detail/input/parser.hpp +++ b/include/nlohmann/detail/input/parser.hpp @@ -147,7 +147,7 @@ class parser } template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) bool sax_parse(SAX* sax, const bool strict = true) { (void)detail::is_sax_static_asserts {}; @@ -167,7 +167,7 @@ class parser private: template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) bool sax_parse_internal(SAX* sax) { // stack to remember the hierarchy of structured values we are parsing @@ -185,7 +185,7 @@ class parser { case token_type::begin_object: { - if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } @@ -193,7 +193,7 @@ class parser // closing } -> we are done if (get_token() == token_type::end_object) { - if (HEDLEY_UNLIKELY(not sax->end_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -201,20 +201,20 @@ class parser } // parse key - if (HEDLEY_UNLIKELY(last_token != token_type::value_string)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"))); } - if (HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -232,7 +232,7 @@ class parser case token_type::begin_array: { - if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } @@ -240,7 +240,7 @@ class parser // closing ] -> we are done if (get_token() == token_type::end_array) { - if (HEDLEY_UNLIKELY(not sax->end_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -258,14 +258,14 @@ class parser { const auto res = m_lexer.get_number_float(); - if (HEDLEY_UNLIKELY(not std::isfinite(res))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not std::isfinite(res))) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); } - if (HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) { return false; } @@ -275,7 +275,7 @@ class parser case token_type::literal_false: { - if (HEDLEY_UNLIKELY(not sax->boolean(false))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->boolean(false))) { return false; } @@ -284,7 +284,7 @@ class parser case token_type::literal_null: { - if (HEDLEY_UNLIKELY(not sax->null())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->null())) { return false; } @@ -293,7 +293,7 @@ class parser case token_type::literal_true: { - if (HEDLEY_UNLIKELY(not sax->boolean(true))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->boolean(true))) { return false; } @@ -302,7 +302,7 @@ class parser case token_type::value_integer: { - if (HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) { return false; } @@ -311,7 +311,7 @@ class parser case token_type::value_string: { - if (HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) { return false; } @@ -320,7 +320,7 @@ class parser case token_type::value_unsigned: { - if (HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) { return false; } @@ -368,9 +368,9 @@ class parser } // closing ] - if (HEDLEY_LIKELY(last_token == token_type::end_array)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) { - if (HEDLEY_UNLIKELY(not sax->end_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -396,7 +396,7 @@ class parser if (get_token() == token_type::value_separator) { // parse key - if (HEDLEY_UNLIKELY(get_token() != token_type::value_string)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -404,13 +404,13 @@ class parser exception_message(token_type::value_string, "object key"))); } - if (HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -424,9 +424,9 @@ class parser } // closing } - if (HEDLEY_LIKELY(last_token == token_type::end_object)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) { - if (HEDLEY_UNLIKELY(not sax->end_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_object())) { return false; } diff --git a/include/nlohmann/detail/iterators/iter_impl.hpp b/include/nlohmann/detail/iterators/iter_impl.hpp index af03cb60..887bcce4 100644 --- a/include/nlohmann/detail/iterators/iter_impl.hpp +++ b/include/nlohmann/detail/iterators/iter_impl.hpp @@ -255,7 +255,7 @@ class iter_impl default: { - if (HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return *m_object; } @@ -289,7 +289,7 @@ class iter_impl default: { - if (HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return m_object; } @@ -392,7 +392,7 @@ class iter_impl bool operator==(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (HEDLEY_UNLIKELY(m_object != other.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -428,7 +428,7 @@ class iter_impl bool operator<(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (HEDLEY_UNLIKELY(m_object != other.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -588,7 +588,7 @@ class iter_impl default: { - if (HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) { return *m_object; } @@ -606,7 +606,7 @@ class iter_impl { assert(m_object != nullptr); - if (HEDLEY_LIKELY(m_object->is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(m_object->is_object())) { return m_it.object_iterator->first; } diff --git a/include/nlohmann/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp index 644504b4..609b433f 100644 --- a/include/nlohmann/detail/json_pointer.hpp +++ b/include/nlohmann/detail/json_pointer.hpp @@ -244,7 +244,7 @@ class json_pointer */ void pop_back() { - if (HEDLEY_UNLIKELY(empty())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -268,7 +268,7 @@ class json_pointer */ const std::string& back() { - if (HEDLEY_UNLIKELY(empty())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -332,7 +332,7 @@ class json_pointer const int res = std::stoi(s, &processed_chars); // check if the string was completely read - if (HEDLEY_UNLIKELY(processed_chars != s.size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) { JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); } @@ -342,7 +342,7 @@ class json_pointer json_pointer top() const { - if (HEDLEY_UNLIKELY(empty())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -474,7 +474,7 @@ class json_pointer case detail::value_t::array: { // error condition (cf. RFC 6901, Sect. 4) - if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -532,7 +532,7 @@ class json_pointer case detail::value_t::array: { - if (HEDLEY_UNLIKELY(reference_token == "-")) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -541,7 +541,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -597,7 +597,7 @@ class json_pointer case detail::value_t::array: { - if (HEDLEY_UNLIKELY(reference_token == "-")) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" cannot be used for const access JSON_THROW(detail::out_of_range::create(402, @@ -606,7 +606,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -656,7 +656,7 @@ class json_pointer case detail::value_t::array: { - if (HEDLEY_UNLIKELY(reference_token == "-")) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -665,7 +665,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -712,7 +712,7 @@ class json_pointer } // check if nonempty reference string begins with slash - if (HEDLEY_UNLIKELY(reference_string[0] != '/')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) { JSON_THROW(detail::parse_error::create(107, 1, "JSON pointer must be empty or begin with '/' - was: '" + @@ -747,9 +747,9 @@ class json_pointer assert(reference_token[pos] == '~'); // ~ must be followed by 0 or 1 - if (HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or - (reference_token[pos + 1] != '0' and - reference_token[pos + 1] != '1'))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or + (reference_token[pos + 1] != '0' and + reference_token[pos + 1] != '1'))) { JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); } @@ -874,7 +874,7 @@ class json_pointer static BasicJsonType unflatten(const BasicJsonType& value) { - if (HEDLEY_UNLIKELY(not value.is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not value.is_object())) { JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); } @@ -884,7 +884,7 @@ class json_pointer // iterate the JSON object values for (const auto& element : *value.m_value.object) { - if (HEDLEY_UNLIKELY(not element.second.is_primitive())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not element.second.is_primitive())) { JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); } diff --git a/include/nlohmann/detail/macro_unscope.hpp b/include/nlohmann/detail/macro_unscope.hpp index 8ad57a57..80b293e7 100644 --- a/include/nlohmann/detail/macro_unscope.hpp +++ b/include/nlohmann/detail/macro_unscope.hpp @@ -17,3 +17,5 @@ #undef JSON_HAS_CPP_17 #undef NLOHMANN_BASIC_JSON_TPL_DECLARATION #undef NLOHMANN_BASIC_JSON_TPL + +#include diff --git a/include/nlohmann/detail/output/binary_writer.hpp b/include/nlohmann/detail/output/binary_writer.hpp index 54206fd4..f09d151e 100644 --- a/include/nlohmann/detail/output/binary_writer.hpp +++ b/include/nlohmann/detail/output/binary_writer.hpp @@ -715,7 +715,7 @@ class binary_writer static std::size_t calc_bson_entry_header_size(const string_t& name) { const auto it = name.find(static_cast(0)); - if (HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) { JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index 65090221..1354a814 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -40,7 +40,7 @@ class output_vector_adapter : public output_adapter_protocol v.push_back(c); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { std::copy(s, s + length, std::back_inserter(v)); @@ -64,7 +64,7 @@ class output_stream_adapter : public output_adapter_protocol stream.put(c); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { stream.write(s, static_cast(length)); @@ -88,7 +88,7 @@ class output_string_adapter : public output_adapter_protocol str.push_back(c); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { str.append(s, length); diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index d17f54d4..7c0a681c 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -110,7 +110,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -183,7 +183,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -498,7 +498,7 @@ class serializer } // we finished processing the string - if (HEDLEY_LIKELY(state == UTF8_ACCEPT)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) { // write buffer if (bytes > 0) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 2443f319..ab8dd2e9 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -319,7 +319,7 @@ class basic_json @since 2.1.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json meta() { basic_json result; @@ -824,7 +824,7 @@ class basic_json /// helper for exception-safe object creation template - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL static T* create(Args&& ... args) { AllocatorType alloc; @@ -951,7 +951,7 @@ class basic_json default: { object = nullptr; // silence warning, see #821 - if (HEDLEY_UNLIKELY(t == value_t::null)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(t == value_t::null)) { JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.6.1")); // LCOV_EXCL_LINE } @@ -1428,7 +1428,7 @@ class basic_json } // if object is wanted but impossible, throw an exception - if (HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) { JSON_THROW(type_error::create(301, "cannot create object from initializer list")); } @@ -1495,7 +1495,7 @@ class basic_json @since version 1.0.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json array(initializer_list_t init = {}) { return basic_json(init, false, value_t::array); @@ -1539,7 +1539,7 @@ class basic_json @since version 1.0.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json object(initializer_list_t init = {}) { return basic_json(init, false, value_t::object); @@ -1638,7 +1638,7 @@ class basic_json assert(last.m_object != nullptr); // make sure iterator fits the current value - if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); } @@ -1655,8 +1655,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -2369,7 +2369,7 @@ class basic_json /// get a boolean (explicit) boolean_t get_impl(boolean_t* /*unused*/) const { - if (HEDLEY_LIKELY(is_boolean())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_boolean())) { return m_value.boolean; } @@ -2478,7 +2478,7 @@ class basic_json // delegate the call to get_ptr<>() auto ptr = obj.template get_ptr::type>(); - if (HEDLEY_LIKELY(ptr != nullptr)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(ptr != nullptr)) { return *ptr; } @@ -2929,7 +2929,7 @@ class basic_json reference at(size_type idx) { // at only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -2976,7 +2976,7 @@ class basic_json const_reference at(size_type idx) const { // at only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -3027,7 +3027,7 @@ class basic_json reference at(const typename object_t::key_type& key) { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -3078,7 +3078,7 @@ class basic_json const_reference at(const typename object_t::key_type& key) const { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -3132,7 +3132,7 @@ class basic_json } // operator[] only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { // fill up array with null values if given idx is outside range if (idx >= m_value.array->size()) @@ -3170,7 +3170,7 @@ class basic_json const_reference operator[](size_type idx) const { // const operator[] only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { return m_value.array->operator[](idx); } @@ -3216,7 +3216,7 @@ class basic_json } // operator[] only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -3257,7 +3257,7 @@ class basic_json const_reference operator[](const typename object_t::key_type& key) const { // const operator[] only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -3294,7 +3294,7 @@ class basic_json @since version 1.1.0 */ template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) reference operator[](T* key) { // implicitly convert null to object @@ -3306,7 +3306,7 @@ class basic_json } // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -3345,11 +3345,11 @@ class basic_json @since version 1.1.0 */ template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) const_reference operator[](T* key) const { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -3413,7 +3413,7 @@ class basic_json ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { // if key is found, return value and given default value otherwise const auto it = find(key); @@ -3485,7 +3485,7 @@ class basic_json ValueType value(const json_pointer& ptr, const ValueType& default_value) const { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { // if pointer resolves a value, return it or use default value JSON_TRY @@ -3505,7 +3505,7 @@ class basic_json @brief overload for a default value of type const char* @copydoc basic_json::value(const json_pointer&, ValueType) const */ - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) string_t value(const json_pointer& ptr, const char* default_value) const { return value(ptr, string_t(default_value)); @@ -3650,7 +3650,7 @@ class basic_json IteratorType erase(IteratorType pos) { // make sure iterator fits the current value - if (HEDLEY_UNLIKELY(this != pos.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(this != pos.m_object)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -3665,7 +3665,7 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) { JSON_THROW(invalid_iterator::create(205, "iterator out of range")); } @@ -3755,7 +3755,7 @@ class basic_json IteratorType erase(IteratorType first, IteratorType last) { // make sure iterator fits the current value - if (HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) { JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); } @@ -3770,8 +3770,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -3842,7 +3842,7 @@ class basic_json size_type erase(const typename object_t::key_type& key) { // this erase only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->erase(key); } @@ -3877,9 +3877,9 @@ class basic_json void erase(const size_type idx) { // this erase only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { - if (HEDLEY_UNLIKELY(idx >= size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(idx >= size())) { JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); } @@ -4355,7 +4355,7 @@ class basic_json future 4.0.0 of the library. Please use @ref items() instead; that is, replace `json::iterator_wrapper(j)` with `j.items()`. */ - HEDLEY_DEPRECATED(3.1.0) + NLOHMANN_JSON_HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(reference ref) noexcept { return ref.items(); @@ -4364,7 +4364,7 @@ class basic_json /*! @copydoc iterator_wrapper(reference) */ - HEDLEY_DEPRECATED(3.1.0) + NLOHMANN_JSON_HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(const_reference ref) noexcept { return ref.items(); @@ -4783,7 +4783,7 @@ class basic_json void push_back(basic_json&& val) { // push_back only works for null objects or arrays - if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4820,7 +4820,7 @@ class basic_json void push_back(const basic_json& val) { // push_back only works for null objects or arrays - if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4870,7 +4870,7 @@ class basic_json void push_back(const typename object_t::value_type& val) { // push_back only works for null objects or objects - if (HEDLEY_UNLIKELY(not(is_null() or is_object()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4971,7 +4971,7 @@ class basic_json void emplace_back(Args&& ... args) { // emplace_back only works for null objects or arrays - if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); } @@ -5019,7 +5019,7 @@ class basic_json std::pair emplace(Args&& ... args) { // emplace only works for null objects or arrays - if (HEDLEY_UNLIKELY(not(is_null() or is_object()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); } @@ -5087,10 +5087,10 @@ class basic_json iterator insert(const_iterator pos, const basic_json& val) { // insert only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (HEDLEY_UNLIKELY(pos.m_object != this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5138,10 +5138,10 @@ class basic_json iterator insert(const_iterator pos, size_type cnt, const basic_json& val) { // insert only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (HEDLEY_UNLIKELY(pos.m_object != this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5186,24 +5186,24 @@ class basic_json iterator insert(const_iterator pos, const_iterator first, const_iterator last) { // insert only works for arrays - if (HEDLEY_UNLIKELY(not is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (HEDLEY_UNLIKELY(pos.m_object != this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } // check if range iterators belong to the same JSON object - if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } - if (HEDLEY_UNLIKELY(first.m_object == this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object == this)) { JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); } @@ -5239,13 +5239,13 @@ class basic_json iterator insert(const_iterator pos, initializer_list_t ilist) { // insert only works for arrays - if (HEDLEY_UNLIKELY(not is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (HEDLEY_UNLIKELY(pos.m_object != this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5280,19 +5280,19 @@ class basic_json void insert(const_iterator first, const_iterator last) { // insert only works for objects - if (HEDLEY_UNLIKELY(not is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (HEDLEY_UNLIKELY(not first.m_object->is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -5329,11 +5329,11 @@ class basic_json assert_invariant(); } - if (HEDLEY_UNLIKELY(not is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } - if (HEDLEY_UNLIKELY(not j.is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); } @@ -5380,20 +5380,20 @@ class basic_json assert_invariant(); } - if (HEDLEY_UNLIKELY(not is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (HEDLEY_UNLIKELY(not first.m_object->is_object() - or not last.m_object->is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_object->is_object() + or not last.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -5456,7 +5456,7 @@ class basic_json void swap(array_t& other) { // swap only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { std::swap(*(m_value.array), other); } @@ -5489,7 +5489,7 @@ class basic_json void swap(object_t& other) { // swap only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { std::swap(*(m_value.object), other); } @@ -5522,7 +5522,7 @@ class basic_json void swap(string_t& other) { // swap only works for strings - if (HEDLEY_LIKELY(is_string())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_string())) { std::swap(*(m_value.string), other); } @@ -6032,7 +6032,7 @@ class basic_json instead; that is, replace calls like `j >> o;` with `o << j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - HEDLEY_DEPRECATED(3.0.0) + NLOHMANN_JSON_HEDLEY_DEPRECATED(3.0.0) friend std::ostream& operator>>(const basic_json& j, std::ostream& o) { return o << j; @@ -6111,7 +6111,7 @@ class basic_json @since version 2.0.3 (contiguous containers) */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json parse(detail::input_adapter&& i, const parser_callback_t cb = nullptr, const bool allow_exceptions = true) @@ -6180,7 +6180,7 @@ class basic_json @since version 3.2.0 */ template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) static bool sax_parse(detail::input_adapter&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true) @@ -6266,7 +6266,7 @@ class basic_json std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits::iterator_category>::value, int>::type = 0> - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) static bool sax_parse(IteratorType first, IteratorType last, SAX* sax) { return parser(detail::input_adapter(first, last)).sax_parse(sax); @@ -6280,7 +6280,7 @@ class basic_json instead; that is, replace calls like `j << i;` with `i >> j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - HEDLEY_DEPRECATED(3.0.0) + NLOHMANN_JSON_HEDLEY_DEPRECATED(3.0.0) friend std::istream& operator<<(basic_json& j, std::istream& i) { return operator>>(i, j); @@ -6353,7 +6353,7 @@ class basic_json @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` since 3.0.0 */ - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL const char* type_name() const noexcept { { @@ -6883,7 +6883,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -6899,7 +6899,7 @@ class basic_json */ template::value, int> = 0> - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -6992,7 +6992,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7008,7 +7008,7 @@ class basic_json */ template::value, int> = 0> - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7080,7 +7080,7 @@ class basic_json @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7096,7 +7096,7 @@ class basic_json */ template::value, int> = 0> - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7167,7 +7167,7 @@ class basic_json @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the related UBJSON format */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7183,7 +7183,7 @@ class basic_json */ template::value, int> = 0> - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7557,7 +7557,7 @@ class basic_json else { const auto idx = json_pointer::array_index(last_path); - if (HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) { // avoid undefined behavior JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); @@ -7588,7 +7588,7 @@ class basic_json { // perform range check auto it = parent.find(last_path); - if (HEDLEY_LIKELY(it != parent.end())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(it != parent.end())) { parent.erase(it); } @@ -7605,7 +7605,7 @@ class basic_json }; // type check: top level value must be an array - if (HEDLEY_UNLIKELY(not json_patch.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not json_patch.is_array())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -7625,13 +7625,13 @@ class basic_json const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; // check if desired value is present - if (HEDLEY_UNLIKELY(it == val.m_value.object->end())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); } // check if result is of type string - if (HEDLEY_UNLIKELY(string_type and not it->second.is_string())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(string_type and not it->second.is_string())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); } @@ -7641,7 +7641,7 @@ class basic_json }; // type check: every element of the array must be an object - if (HEDLEY_UNLIKELY(not val.is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not val.is_object())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -7719,7 +7719,7 @@ class basic_json } // throw an exception if test fails - if (HEDLEY_UNLIKELY(not success)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not success)) { JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); } @@ -7772,7 +7772,7 @@ class basic_json @since version 2.0.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json diff(const basic_json& source, const basic_json& target, const std::string& path = "") { @@ -8064,7 +8064,7 @@ if no parse error occurred. @since version 1.0.0 */ -HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_NON_NULL(1) inline nlohmann::json operator "" _json(const char* s, std::size_t n) { return nlohmann::json::parse(s, s + n); @@ -8083,7 +8083,7 @@ object if no parse error occurred. @since version 2.0.0 */ -HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_NON_NULL(1) inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) { return nlohmann::json::json_pointer(std::string(s, n)); diff --git a/include/nlohmann/thirdparty/hedley/hedley.hpp b/include/nlohmann/thirdparty/hedley/hedley.hpp index eb4c2018..31d63a6b 100644 --- a/include/nlohmann/thirdparty/hedley/hedley.hpp +++ b/include/nlohmann/thirdparty/hedley/hedley.hpp @@ -10,1257 +10,1257 @@ * SPDX-License-Identifier: CC0-1.0 */ -#if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 9) -#if defined(HEDLEY_VERSION) - #undef HEDLEY_VERSION +#if !defined(NLOHMANN_JSON_HEDLEY_VERSION) || (NLOHMANN_JSON_HEDLEY_VERSION < 9) +#if defined(NLOHMANN_JSON_HEDLEY_VERSION) + #undef NLOHMANN_JSON_HEDLEY_VERSION #endif -#define HEDLEY_VERSION 9 +#define NLOHMANN_JSON_HEDLEY_VERSION 9 -#if defined(HEDLEY_STRINGIFY_EX) - #undef HEDLEY_STRINGIFY_EX +#if defined(NLOHMANN_JSON_HEDLEY_STRINGIFY_EX) + #undef NLOHMANN_JSON_HEDLEY_STRINGIFY_EX #endif -#define HEDLEY_STRINGIFY_EX(x) #x +#define NLOHMANN_JSON_HEDLEY_STRINGIFY_EX(x) #x -#if defined(HEDLEY_STRINGIFY) - #undef HEDLEY_STRINGIFY +#if defined(NLOHMANN_JSON_HEDLEY_STRINGIFY) + #undef NLOHMANN_JSON_HEDLEY_STRINGIFY #endif -#define HEDLEY_STRINGIFY(x) HEDLEY_STRINGIFY_EX(x) +#define NLOHMANN_JSON_HEDLEY_STRINGIFY(x) NLOHMANN_JSON_HEDLEY_STRINGIFY_EX(x) -#if defined(HEDLEY_CONCAT_EX) - #undef HEDLEY_CONCAT_EX +#if defined(NLOHMANN_JSON_HEDLEY_CONCAT_EX) + #undef NLOHMANN_JSON_HEDLEY_CONCAT_EX #endif -#define HEDLEY_CONCAT_EX(a,b) a##b +#define NLOHMANN_JSON_HEDLEY_CONCAT_EX(a,b) a##b -#if defined(HEDLEY_CONCAT) - #undef HEDLEY_CONCAT +#if defined(NLOHMANN_JSON_HEDLEY_CONCAT) + #undef NLOHMANN_JSON_HEDLEY_CONCAT #endif -#define HEDLEY_CONCAT(a,b) HEDLEY_CONCAT_EX(a,b) +#define NLOHMANN_JSON_HEDLEY_CONCAT(a,b) NLOHMANN_JSON_HEDLEY_CONCAT_EX(a,b) -#if defined(HEDLEY_VERSION_ENCODE) - #undef HEDLEY_VERSION_ENCODE +#if defined(NLOHMANN_JSON_HEDLEY_VERSION_ENCODE) + #undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE #endif -#define HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) +#define NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) -#if defined(HEDLEY_VERSION_DECODE_MAJOR) - #undef HEDLEY_VERSION_DECODE_MAJOR +#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR #endif -#define HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) +#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) -#if defined(HEDLEY_VERSION_DECODE_MINOR) - #undef HEDLEY_VERSION_DECODE_MINOR +#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR #endif -#define HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) +#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) -#if defined(HEDLEY_VERSION_DECODE_REVISION) - #undef HEDLEY_VERSION_DECODE_REVISION +#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION #endif -#define HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) +#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) -#if defined(HEDLEY_GNUC_VERSION) - #undef HEDLEY_GNUC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION #endif #if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) - #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) + #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) #elif defined(__GNUC__) - #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) + #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) #endif -#if defined(HEDLEY_GNUC_VERSION_CHECK) - #undef HEDLEY_GNUC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK #endif -#if defined(HEDLEY_GNUC_VERSION) - #define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (HEDLEY_GNUC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) + #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_GNUC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_MSVC_VERSION) - #undef HEDLEY_MSVC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_MSVC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION #endif #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) - #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) #elif defined(_MSC_FULL_VER) - #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) #elif defined(_MSC_VER) - #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) #endif -#if defined(HEDLEY_MSVC_VERSION_CHECK) - #undef HEDLEY_MSVC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK #endif #if !defined(_MSC_VER) - #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) #elif defined(_MSC_VER) && (_MSC_VER >= 1400) - #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) #elif defined(_MSC_VER) && (_MSC_VER >= 1200) - #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) #else - #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) #endif -#if defined(HEDLEY_INTEL_VERSION) - #undef HEDLEY_INTEL_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) + #undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION #endif #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) - #define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) + #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) #elif defined(__INTEL_COMPILER) - #define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) + #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) #endif -#if defined(HEDLEY_INTEL_VERSION_CHECK) - #undef HEDLEY_INTEL_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK #endif -#if defined(HEDLEY_INTEL_VERSION) - #define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (HEDLEY_INTEL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) + #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_INTEL_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_PGI_VERSION) - #undef HEDLEY_PGI_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) + #undef NLOHMANN_JSON_HEDLEY_PGI_VERSION #endif #if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) - #define HEDLEY_PGI_VERSION HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) + #define NLOHMANN_JSON_HEDLEY_PGI_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) #endif -#if defined(HEDLEY_PGI_VERSION_CHECK) - #undef HEDLEY_PGI_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK #endif -#if defined(HEDLEY_PGI_VERSION) - #define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (HEDLEY_PGI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) + #define NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_PGI_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_SUNPRO_VERSION) - #undef HEDLEY_SUNPRO_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) + #undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION #endif #if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) - #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) #elif defined(__SUNPRO_C) - #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) #elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) - #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) #elif defined(__SUNPRO_CC) - #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) #endif -#if defined(HEDLEY_SUNPRO_VERSION_CHECK) - #undef HEDLEY_SUNPRO_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK #endif -#if defined(HEDLEY_SUNPRO_VERSION) - #define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (HEDLEY_SUNPRO_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_EMSCRIPTEN_VERSION) - #undef HEDLEY_EMSCRIPTEN_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION #endif #if defined(__EMSCRIPTEN__) - #define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) + #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) #endif -#if defined(HEDLEY_EMSCRIPTEN_VERSION_CHECK) - #undef HEDLEY_EMSCRIPTEN_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK #endif -#if defined(HEDLEY_EMSCRIPTEN_VERSION) - #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (HEDLEY_EMSCRIPTEN_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_ARM_VERSION) - #undef HEDLEY_ARM_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) + #undef NLOHMANN_JSON_HEDLEY_ARM_VERSION #endif #if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) - #define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) + #define NLOHMANN_JSON_HEDLEY_ARM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) #elif defined(__CC_ARM) && defined(__ARMCC_VERSION) - #define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) + #define NLOHMANN_JSON_HEDLEY_ARM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) #endif -#if defined(HEDLEY_ARM_VERSION_CHECK) - #undef HEDLEY_ARM_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK #endif -#if defined(HEDLEY_ARM_VERSION) - #define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (HEDLEY_ARM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) + #define NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_ARM_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_IBM_VERSION) - #undef HEDLEY_IBM_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION) + #undef NLOHMANN_JSON_HEDLEY_IBM_VERSION #endif #if defined(__ibmxl__) - #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) #elif defined(__xlC__) && defined(__xlC_ver__) - #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) #elif defined(__xlC__) - #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) #endif -#if defined(HEDLEY_IBM_VERSION_CHECK) - #undef HEDLEY_IBM_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK #endif -#if defined(HEDLEY_IBM_VERSION) - #define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (HEDLEY_IBM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_IBM_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_TI_VERSION) - #undef HEDLEY_TI_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) + #undef NLOHMANN_JSON_HEDLEY_TI_VERSION #endif #if defined(__TI_COMPILER_VERSION__) - #define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) + #define NLOHMANN_JSON_HEDLEY_TI_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) #endif -#if defined(HEDLEY_TI_VERSION_CHECK) - #undef HEDLEY_TI_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK #endif -#if defined(HEDLEY_TI_VERSION) - #define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) + #define NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_TI_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_CRAY_VERSION) - #undef HEDLEY_CRAY_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION) + #undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION #endif #if defined(_CRAYC) #if defined(_RELEASE_PATCHLEVEL) - #define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) #else - #define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) #endif #endif -#if defined(HEDLEY_CRAY_VERSION_CHECK) - #undef HEDLEY_CRAY_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK #endif -#if defined(HEDLEY_CRAY_VERSION) - #define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (HEDLEY_CRAY_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION) + #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_CRAY_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_IAR_VERSION) - #undef HEDLEY_IAR_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION) + #undef NLOHMANN_JSON_HEDLEY_IAR_VERSION #endif #if defined(__IAR_SYSTEMS_ICC__) #if __VER__ > 1000 - #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #define NLOHMANN_JSON_HEDLEY_IAR_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) #else - #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #define NLOHMANN_JSON_HEDLEY_IAR_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) #endif #endif -#if defined(HEDLEY_IAR_VERSION_CHECK) - #undef HEDLEY_IAR_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK #endif -#if defined(HEDLEY_IAR_VERSION) - #define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (HEDLEY_IAR_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION) + #define NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_IAR_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_TINYC_VERSION) - #undef HEDLEY_TINYC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION #endif #if defined(__TINYC__) - #define HEDLEY_TINYC_VERSION HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) + #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) #endif -#if defined(HEDLEY_TINYC_VERSION_CHECK) - #undef HEDLEY_TINYC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK #endif -#if defined(HEDLEY_TINYC_VERSION) - #define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (HEDLEY_TINYC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) + #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_TINYC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_DMC_VERSION) - #undef HEDLEY_DMC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_DMC_VERSION #endif #if defined(__DMC__) - #define HEDLEY_DMC_VERSION HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) + #define NLOHMANN_JSON_HEDLEY_DMC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) #endif -#if defined(HEDLEY_DMC_VERSION_CHECK) - #undef HEDLEY_DMC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK #endif -#if defined(HEDLEY_DMC_VERSION) - #define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (HEDLEY_DMC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION) + #define NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_DMC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_COMPCERT_VERSION) - #undef HEDLEY_COMPCERT_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION) + #undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION #endif #if defined(__COMPCERT_VERSION__) - #define HEDLEY_COMPCERT_VERSION HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) + #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) #endif -#if defined(HEDLEY_COMPCERT_VERSION_CHECK) - #undef HEDLEY_COMPCERT_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK #endif -#if defined(HEDLEY_COMPCERT_VERSION) - #define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (HEDLEY_COMPCERT_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION) + #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_PELLES_VERSION) - #undef HEDLEY_PELLES_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION) + #undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION #endif #if defined(__POCC__) - #define HEDLEY_PELLES_VERSION HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) + #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) #endif -#if defined(HEDLEY_PELLES_VERSION_CHECK) - #undef HEDLEY_PELLES_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK #endif -#if defined(HEDLEY_PELLES_VERSION) - #define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (HEDLEY_PELLES_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION) + #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_PELLES_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_GCC_VERSION) - #undef HEDLEY_GCC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_GCC_VERSION #endif #if \ - defined(HEDLEY_GNUC_VERSION) && \ + defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) && \ !defined(__clang__) && \ - !defined(HEDLEY_INTEL_VERSION) && \ - !defined(HEDLEY_PGI_VERSION) && \ - !defined(HEDLEY_ARM_VERSION) && \ - !defined(HEDLEY_TI_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) && \ !defined(__COMPCERT__) - #define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION + #define NLOHMANN_JSON_HEDLEY_GCC_VERSION NLOHMANN_JSON_HEDLEY_GNUC_VERSION #endif -#if defined(HEDLEY_GCC_VERSION_CHECK) - #undef HEDLEY_GCC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK #endif -#if defined(HEDLEY_GCC_VERSION) - #define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (HEDLEY_GCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) + #define NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_GCC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_HAS_ATTRIBUTE) - #undef HEDLEY_HAS_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) #else - #define HEDLEY_HAS_ATTRIBUTE(attribute) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) #endif -#if defined(HEDLEY_GNUC_HAS_ATTRIBUTE) - #undef HEDLEY_GNUC_HAS_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) #else - #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_ATTRIBUTE) - #undef HEDLEY_GCC_HAS_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) #else - #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_CPP_ATTRIBUTE) - #undef HEDLEY_HAS_CPP_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) #else - #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) #endif -#if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) - #undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) #else - #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_CPP_ATTRIBUTE) - #undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) #else - #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_BUILTIN) - #undef HEDLEY_HAS_BUILTIN +#if defined(NLOHMANN_JSON_HEDLEY_HAS_BUILTIN) + #undef NLOHMANN_JSON_HEDLEY_HAS_BUILTIN #endif #if defined(__has_builtin) - #define HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) + #define NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) #else - #define HEDLEY_HAS_BUILTIN(builtin) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) (0) #endif -#if defined(HEDLEY_GNUC_HAS_BUILTIN) - #undef HEDLEY_GNUC_HAS_BUILTIN +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN #endif #if defined(__has_builtin) - #define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) #else - #define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_BUILTIN) - #undef HEDLEY_GCC_HAS_BUILTIN +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN #endif #if defined(__has_builtin) - #define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) #else - #define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_FEATURE) - #undef HEDLEY_HAS_FEATURE +#if defined(NLOHMANN_JSON_HEDLEY_HAS_FEATURE) + #undef NLOHMANN_JSON_HEDLEY_HAS_FEATURE #endif #if defined(__has_feature) - #define HEDLEY_HAS_FEATURE(feature) __has_feature(feature) + #define NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) #else - #define HEDLEY_HAS_FEATURE(feature) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) (0) #endif -#if defined(HEDLEY_GNUC_HAS_FEATURE) - #undef HEDLEY_GNUC_HAS_FEATURE +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE #endif #if defined(__has_feature) - #define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) #else - #define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_FEATURE) - #undef HEDLEY_GCC_HAS_FEATURE +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE #endif #if defined(__has_feature) - #define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) #else - #define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_EXTENSION) - #undef HEDLEY_HAS_EXTENSION +#if defined(NLOHMANN_JSON_HEDLEY_HAS_EXTENSION) + #undef NLOHMANN_JSON_HEDLEY_HAS_EXTENSION #endif #if defined(__has_extension) - #define HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) + #define NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) #else - #define HEDLEY_HAS_EXTENSION(extension) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) (0) #endif -#if defined(HEDLEY_GNUC_HAS_EXTENSION) - #undef HEDLEY_GNUC_HAS_EXTENSION +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION #endif #if defined(__has_extension) - #define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) #else - #define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_EXTENSION) - #undef HEDLEY_GCC_HAS_EXTENSION +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION #endif #if defined(__has_extension) - #define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) #else - #define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_DECLSPEC_ATTRIBUTE) - #undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) #else - #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) #endif -#if defined(HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) - #undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) #else - #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) - #undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) #else - #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_WARNING) - #undef HEDLEY_HAS_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_HAS_WARNING) + #undef NLOHMANN_JSON_HEDLEY_HAS_WARNING #endif #if defined(__has_warning) - #define HEDLEY_HAS_WARNING(warning) __has_warning(warning) + #define NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) #else - #define HEDLEY_HAS_WARNING(warning) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) (0) #endif -#if defined(HEDLEY_GNUC_HAS_WARNING) - #undef HEDLEY_GNUC_HAS_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING #endif #if defined(__has_warning) - #define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) #else - #define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_WARNING) - #undef HEDLEY_GCC_HAS_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING #endif #if defined(__has_warning) - #define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) #else - #define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif #if \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ defined(__clang__) || \ - HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ - HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_TI_VERSION_CHECK(6,0,0) || \ - HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ - HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ - (HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) - #define HEDLEY_PRAGMA(value) _Pragma(#value) -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define HEDLEY_PRAGMA(value) __pragma(value) + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) || \ + NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) __pragma(value) #else - #define HEDLEY_PRAGMA(value) + #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) #endif -#if defined(HEDLEY_DIAGNOSTIC_PUSH) - #undef HEDLEY_DIAGNOSTIC_PUSH +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH #endif -#if defined(HEDLEY_DIAGNOSTIC_POP) - #undef HEDLEY_DIAGNOSTIC_POP +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP #endif #if defined(__clang__) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") -#elif HEDLEY_GCC_VERSION_CHECK(4,6,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) - #define HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) -#elif HEDLEY_ARM_VERSION_CHECK(5,6,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("pop") -#elif HEDLEY_TI_VERSION_CHECK(8,1,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") -#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,1,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") #else - #define HEDLEY_DIAGNOSTIC_PUSH - #define HEDLEY_DIAGNOSTIC_POP + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP #endif -#if defined(HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) - #undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED #endif -#if HEDLEY_HAS_WARNING("-Wdeprecated-declarations") - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") -#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") -#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) -#elif HEDLEY_TI_VERSION_CHECK(8,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") -#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") -#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") -#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") #else - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED #endif -#if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) - #undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS #endif -#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") -#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") -#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) -#elif HEDLEY_TI_VERSION_CHECK(8,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") #else - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS #endif -#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) - #undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL #endif -#if HEDLEY_HAS_WARNING("-Wcast-qual") - #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") -#elif HEDLEY_GCC_VERSION_CHECK(3,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") #else - #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL #endif -#if defined(HEDLEY_DEPRECATED) - #undef HEDLEY_DEPRECATED +#if defined(NLOHMANN_JSON_HEDLEY_DEPRECATED) + #undef NLOHMANN_JSON_HEDLEY_DEPRECATED #endif -#if defined(HEDLEY_DEPRECATED_FOR) - #undef HEDLEY_DEPRECATED_FOR +#if defined(NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR) + #undef NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR #endif #if defined(__cplusplus) && (__cplusplus >= 201402L) - #define HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] - #define HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] #elif \ - HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ - HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ - HEDLEY_TI_VERSION_CHECK(8,3,0) - #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) - #define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) + NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,3,0) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) #elif \ - HEDLEY_HAS_ATTRIBUTE(deprecated) || \ - HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) - #define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) -#elif HEDLEY_MSVC_VERSION_CHECK(14,0,0) - #define HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) - #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) #elif \ - HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ - HEDLEY_PELLES_VERSION_CHECK(6,50,0) - #define HEDLEY_DEPRECATED(since) _declspec(deprecated) - #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_DEPRECATED(since) _Pragma("deprecated") - #define HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) _declspec(deprecated) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") #else - #define HEDLEY_DEPRECATED(since) - #define HEDLEY_DEPRECATED_FOR(since, replacement) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) #endif -#if defined(HEDLEY_UNAVAILABLE) - #undef HEDLEY_UNAVAILABLE +#if defined(NLOHMANN_JSON_HEDLEY_UNAVAILABLE) + #undef NLOHMANN_JSON_HEDLEY_UNAVAILABLE #endif #if \ - HEDLEY_HAS_ATTRIBUTE(warning) || \ - HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) #else - #define HEDLEY_UNAVAILABLE(available_since) + #define NLOHMANN_JSON_HEDLEY_UNAVAILABLE(available_since) #endif -#if defined(HEDLEY_WARN_UNUSED_RESULT) - #undef HEDLEY_WARN_UNUSED_RESULT +#if defined(NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT #endif #if defined(__cplusplus) && (__cplusplus >= 201703L) - #define HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] + #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] #elif \ - HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ - HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) #elif defined(_Check_return_) /* SAL */ - #define HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ #else - #define HEDLEY_WARN_UNUSED_RESULT + #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT #endif -#if defined(HEDLEY_SENTINEL) - #undef HEDLEY_SENTINEL +#if defined(NLOHMANN_JSON_HEDLEY_SENTINEL) + #undef NLOHMANN_JSON_HEDLEY_SENTINEL #endif #if \ - HEDLEY_HAS_ATTRIBUTE(sentinel) || \ - HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,4,0) - #define HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define NLOHMANN_JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) #else - #define HEDLEY_SENTINEL(position) + #define NLOHMANN_JSON_HEDLEY_SENTINEL(position) #endif -#if defined(HEDLEY_NO_RETURN) - #undef HEDLEY_NO_RETURN +#if defined(NLOHMANN_JSON_HEDLEY_NO_RETURN) + #undef NLOHMANN_JSON_HEDLEY_NO_RETURN #endif -#if HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_NO_RETURN __noreturn -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#if NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __noreturn +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - #define HEDLEY_NO_RETURN _Noreturn + #define NLOHMANN_JSON_HEDLEY_NO_RETURN _Noreturn #elif defined(__cplusplus) && (__cplusplus >= 201103L) - #define HEDLEY_NO_RETURN [[noreturn]] + #define NLOHMANN_JSON_HEDLEY_NO_RETURN [[noreturn]] #elif \ - HEDLEY_HAS_ATTRIBUTE(noreturn) || \ - HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(18,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_NO_RETURN __attribute__((__noreturn__)) -#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define HEDLEY_NO_RETURN __declspec(noreturn) -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") -#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) - #define HEDLEY_NO_RETURN __attribute((noreturn)) -#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) - #define HEDLEY_NO_RETURN __declspec(noreturn) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(18,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __declspec(noreturn) #else - #define HEDLEY_NO_RETURN + #define NLOHMANN_JSON_HEDLEY_NO_RETURN #endif -#if defined(HEDLEY_UNREACHABLE) - #undef HEDLEY_UNREACHABLE +#if defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE) + #undef NLOHMANN_JSON_HEDLEY_UNREACHABLE #endif -#if defined(HEDLEY_UNREACHABLE_RETURN) - #undef HEDLEY_UNREACHABLE_RETURN +#if defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN) + #undef NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN #endif #if \ - (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) || \ - HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,5) - #define HEDLEY_UNREACHABLE() __builtin_unreachable() -#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define HEDLEY_UNREACHABLE() __assume(0) -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) + (NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION))) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() __assume(0) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) #if defined(__cplusplus) - #define HEDLEY_UNREACHABLE() std::_nassert(0) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() std::_nassert(0) #else - #define HEDLEY_UNREACHABLE() _nassert(0) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() _nassert(0) #endif - #define HEDLEY_UNREACHABLE_RETURN(value) return value + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) return value #elif defined(EXIT_FAILURE) - #define HEDLEY_UNREACHABLE() abort() + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() abort() #else - #define HEDLEY_UNREACHABLE() - #define HEDLEY_UNREACHABLE_RETURN(value) return value + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) return value #endif -#if !defined(HEDLEY_UNREACHABLE_RETURN) - #define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE() +#if !defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) NLOHMANN_JSON_HEDLEY_UNREACHABLE() #endif -#if defined(HEDLEY_ASSUME) - #undef HEDLEY_ASSUME +#if defined(NLOHMANN_JSON_HEDLEY_ASSUME) + #undef NLOHMANN_JSON_HEDLEY_ASSUME #endif #if \ - HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_ASSUME(expr) __assume(expr) -#elif HEDLEY_HAS_BUILTIN(__builtin_assume) - #define HEDLEY_ASSUME(expr) __builtin_assume(expr) -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) #if defined(__cplusplus) - #define HEDLEY_ASSUME(expr) std::_nassert(expr) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) #else - #define HEDLEY_ASSUME(expr) _nassert(expr) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) _nassert(expr) #endif #elif \ - (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(HEDLEY_ARM_VERSION)) || \ - HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,5) - #define HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) + (NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION)) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) #else - #define HEDLEY_ASSUME(expr) ((void) (expr)) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) ((void) (expr)) #endif -HEDLEY_DIAGNOSTIC_PUSH +NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH #if \ - HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ - HEDLEY_GCC_VERSION_CHECK(4,0,0) + NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) #if defined(__clang__) #pragma clang diagnostic ignored "-Wvariadic-macros" - #elif defined(HEDLEY_GCC_VERSION) + #elif defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) #pragma GCC diagnostic ignored "-Wvariadic-macros" #endif #endif -#if defined(HEDLEY_NON_NULL) - #undef HEDLEY_NON_NULL +#if defined(NLOHMANN_JSON_HEDLEY_NON_NULL) + #undef NLOHMANN_JSON_HEDLEY_NON_NULL #endif #if \ - HEDLEY_HAS_ATTRIBUTE(nonnull) || \ - HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) - #define HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define NLOHMANN_JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) #else - #define HEDLEY_NON_NULL(...) + #define NLOHMANN_JSON_HEDLEY_NON_NULL(...) #endif -HEDLEY_DIAGNOSTIC_POP +NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP -#if defined(HEDLEY_PRINTF_FORMAT) - #undef HEDLEY_PRINTF_FORMAT +#if defined(NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT) + #undef NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT #endif -#if defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) -#elif defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#if defined(__MINGW32__) && NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) #elif \ - HEDLEY_HAS_ATTRIBUTE(format) || \ - HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) -#elif HEDLEY_PELLES_VERSION_CHECK(6,0,0) - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) #else - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) #endif -#if defined(HEDLEY_CONSTEXPR) - #undef HEDLEY_CONSTEXPR +#if defined(NLOHMANN_JSON_HEDLEY_CONSTEXPR) + #undef NLOHMANN_JSON_HEDLEY_CONSTEXPR #endif #if defined(__cplusplus) #if __cplusplus >= 201103L - #define HEDLEY_CONSTEXPR constexpr + #define NLOHMANN_JSON_HEDLEY_CONSTEXPR constexpr #endif #endif -#if !defined(HEDLEY_CONSTEXPR) - #define HEDLEY_CONSTEXPR +#if !defined(NLOHMANN_JSON_HEDLEY_CONSTEXPR) + #define NLOHMANN_JSON_HEDLEY_CONSTEXPR #endif -#if defined(HEDLEY_PREDICT) - #undef HEDLEY_PREDICT +#if defined(NLOHMANN_JSON_HEDLEY_PREDICT) + #undef NLOHMANN_JSON_HEDLEY_PREDICT #endif -#if defined(HEDLEY_LIKELY) - #undef HEDLEY_LIKELY +#if defined(NLOHMANN_JSON_HEDLEY_LIKELY) + #undef NLOHMANN_JSON_HEDLEY_LIKELY #endif -#if defined(HEDLEY_UNLIKELY) - #undef HEDLEY_UNLIKELY +#if defined(NLOHMANN_JSON_HEDLEY_UNLIKELY) + #undef NLOHMANN_JSON_HEDLEY_UNLIKELY #endif -#if defined(HEDLEY_UNPREDICTABLE) - #undef HEDLEY_UNPREDICTABLE +#if defined(NLOHMANN_JSON_HEDLEY_UNPREDICTABLE) + #undef NLOHMANN_JSON_HEDLEY_UNPREDICTABLE #endif -#if HEDLEY_HAS_BUILTIN(__builtin_unpredictable) - #define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) +#if NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define NLOHMANN_JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) #endif #if \ - HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ - HEDLEY_GCC_VERSION_CHECK(9,0,0) -# define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) -# define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) -# define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) -# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) -#if !defined(HEDLEY_BUILTIN_UNPREDICTABLE) - #define HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) + NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) +# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) +# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) +# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#if !defined(NLOHMANN_JSON_HEDLEY_BUILTIN_UNPREDICTABLE) + #define NLOHMANN_JSON_HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) #endif #elif \ - HEDLEY_HAS_BUILTIN(__builtin_expect) || \ - HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(6,1,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,27) -# define HEDLEY_PREDICT(expr, expected, probability) \ + NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) +# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, expected, probability) \ (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void) (expected)), !!(expr))) -# define HEDLEY_PREDICT_TRUE(expr, probability) \ +# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ (__extension__ ({ \ - HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + NLOHMANN_JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ })) -# define HEDLEY_PREDICT_FALSE(expr, probability) \ +# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ (__extension__ ({ \ - HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + NLOHMANN_JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ })) -# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) #else -# define HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) -# define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) -# define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) -# define HEDLEY_LIKELY(expr) (!!(expr)) -# define HEDLEY_UNLIKELY(expr) (!!(expr)) +# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) +# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) #endif -#if !defined(HEDLEY_UNPREDICTABLE) - #define HEDLEY_UNPREDICTABLE(expr) HEDLEY_PREDICT(expr, 1, 0.5) +#if !defined(NLOHMANN_JSON_HEDLEY_UNPREDICTABLE) + #define NLOHMANN_JSON_HEDLEY_UNPREDICTABLE(expr) NLOHMANN_JSON_HEDLEY_PREDICT(expr, 1, 0.5) #endif -#if defined(HEDLEY_MALLOC) - #undef HEDLEY_MALLOC +#if defined(NLOHMANN_JSON_HEDLEY_MALLOC) + #undef NLOHMANN_JSON_HEDLEY_MALLOC #endif #if \ - HEDLEY_HAS_ATTRIBUTE(malloc) || \ - HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_MALLOC __attribute__((__malloc__)) -#elif HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) - #define HEDLEY_MALLOC __declspec(restrict) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define NLOHMANN_JSON_HEDLEY_MALLOC __declspec(restrict) #else - #define HEDLEY_MALLOC + #define NLOHMANN_JSON_HEDLEY_MALLOC #endif -#if defined(HEDLEY_PURE) - #undef HEDLEY_PURE +#if defined(NLOHMANN_JSON_HEDLEY_PURE) + #undef NLOHMANN_JSON_HEDLEY_PURE #endif #if \ - HEDLEY_HAS_ATTRIBUTE(pure) || \ - HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_PURE __attribute__((__pure__)) -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define HEDLEY_PURE _Pragma("FUNC_IS_PURE;") + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") #else - #define HEDLEY_PURE + #define NLOHMANN_JSON_HEDLEY_PURE #endif -#if defined(HEDLEY_CONST) - #undef HEDLEY_CONST +#if defined(NLOHMANN_JSON_HEDLEY_CONST) + #undef NLOHMANN_JSON_HEDLEY_CONST #endif #if \ - HEDLEY_HAS_ATTRIBUTE(const) || \ - HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_CONST __attribute__((__const__)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_CONST __attribute__((__const__)) #else - #define HEDLEY_CONST HEDLEY_PURE + #define NLOHMANN_JSON_HEDLEY_CONST NLOHMANN_JSON_HEDLEY_PURE #endif -#if defined(HEDLEY_RESTRICT) - #undef HEDLEY_RESTRICT +#if defined(NLOHMANN_JSON_HEDLEY_RESTRICT) + #undef NLOHMANN_JSON_HEDLEY_RESTRICT #endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) - #define HEDLEY_RESTRICT restrict + #define NLOHMANN_JSON_HEDLEY_RESTRICT restrict #elif \ - HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ - HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ defined(__clang__) - #define HEDLEY_RESTRICT __restrict -#elif HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) - #define HEDLEY_RESTRICT _Restrict + #define NLOHMANN_JSON_HEDLEY_RESTRICT __restrict +#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_RESTRICT _Restrict #else - #define HEDLEY_RESTRICT + #define NLOHMANN_JSON_HEDLEY_RESTRICT #endif -#if defined(HEDLEY_INLINE) - #undef HEDLEY_INLINE +#if defined(NLOHMANN_JSON_HEDLEY_INLINE) + #undef NLOHMANN_JSON_HEDLEY_INLINE #endif #if \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ (defined(__cplusplus) && (__cplusplus >= 199711L)) - #define HEDLEY_INLINE inline + #define NLOHMANN_JSON_HEDLEY_INLINE inline #elif \ - defined(HEDLEY_GCC_VERSION) || \ - HEDLEY_ARM_VERSION_CHECK(6,2,0) - #define HEDLEY_INLINE __inline__ + defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define NLOHMANN_JSON_HEDLEY_INLINE __inline__ #elif \ - HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) - #define HEDLEY_INLINE __inline + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_INLINE __inline #else - #define HEDLEY_INLINE + #define NLOHMANN_JSON_HEDLEY_INLINE #endif -#if defined(HEDLEY_ALWAYS_INLINE) - #undef HEDLEY_ALWAYS_INLINE +#if defined(NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE) + #undef NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE #endif #if \ - HEDLEY_HAS_ATTRIBUTE(always_inline) || \ - HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE -#elif HEDLEY_MSVC_VERSION_CHECK(12,0,0) - #define HEDLEY_ALWAYS_INLINE __forceinline -#elif HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) - #define HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) NLOHMANN_JSON_HEDLEY_INLINE +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") #else - #define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE NLOHMANN_JSON_HEDLEY_INLINE #endif -#if defined(HEDLEY_NEVER_INLINE) - #undef HEDLEY_NEVER_INLINE +#if defined(NLOHMANN_JSON_HEDLEY_NEVER_INLINE) + #undef NLOHMANN_JSON_HEDLEY_NEVER_INLINE #endif #if \ - HEDLEY_HAS_ATTRIBUTE(noinline) || \ - HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_NEVER_INLINE __attribute__((__noinline__)) -#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define HEDLEY_NEVER_INLINE __declspec(noinline) -#elif HEDLEY_PGI_VERSION_CHECK(10,2,0) - #define HEDLEY_NEVER_INLINE _Pragma("noinline") -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_NEVER_INLINE _Pragma("inline=never") -#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) - #define HEDLEY_NEVER_INLINE __attribute((noinline)) -#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) - #define HEDLEY_NEVER_INLINE __declspec(noinline) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __declspec(noinline) #else - #define HEDLEY_NEVER_INLINE + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE #endif -#if defined(HEDLEY_PRIVATE) - #undef HEDLEY_PRIVATE +#if defined(NLOHMANN_JSON_HEDLEY_PRIVATE) + #undef NLOHMANN_JSON_HEDLEY_PRIVATE #endif -#if defined(HEDLEY_PUBLIC) - #undef HEDLEY_PUBLIC +#if defined(NLOHMANN_JSON_HEDLEY_PUBLIC) + #undef NLOHMANN_JSON_HEDLEY_PUBLIC #endif -#if defined(HEDLEY_IMPORT) - #undef HEDLEY_IMPORT +#if defined(NLOHMANN_JSON_HEDLEY_IMPORT) + #undef NLOHMANN_JSON_HEDLEY_IMPORT #endif #if defined(_WIN32) || defined(__CYGWIN__) - #define HEDLEY_PRIVATE - #define HEDLEY_PUBLIC __declspec(dllexport) - #define HEDLEY_IMPORT __declspec(dllimport) + #define NLOHMANN_JSON_HEDLEY_PRIVATE + #define NLOHMANN_JSON_HEDLEY_PUBLIC __declspec(dllexport) + #define NLOHMANN_JSON_HEDLEY_IMPORT __declspec(dllimport) #else #if \ - HEDLEY_HAS_ATTRIBUTE(visibility) || \ - HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) - #define HEDLEY_PUBLIC __attribute__((__visibility__("default"))) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) + #define NLOHMANN_JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) #else - #define HEDLEY_PRIVATE - #define HEDLEY_PUBLIC + #define NLOHMANN_JSON_HEDLEY_PRIVATE + #define NLOHMANN_JSON_HEDLEY_PUBLIC #endif - #define HEDLEY_IMPORT extern + #define NLOHMANN_JSON_HEDLEY_IMPORT extern #endif -#if defined(HEDLEY_NO_THROW) - #undef HEDLEY_NO_THROW +#if defined(NLOHMANN_JSON_HEDLEY_NO_THROW) + #undef NLOHMANN_JSON_HEDLEY_NO_THROW #endif #if \ - HEDLEY_HAS_ATTRIBUTE(nothrow) || \ - HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_NO_THROW __attribute__((__nothrow__)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) #elif \ - HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) - #define HEDLEY_NO_THROW __declspec(nothrow) + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define NLOHMANN_JSON_HEDLEY_NO_THROW __declspec(nothrow) #else - #define HEDLEY_NO_THROW + #define NLOHMANN_JSON_HEDLEY_NO_THROW #endif -#if defined(HEDLEY_FALL_THROUGH) - #undef HEDLEY_FALL_THROUGH +#if defined(NLOHMANN_JSON_HEDLEY_FALL_THROUGH) + #undef NLOHMANN_JSON_HEDLEY_FALL_THROUGH #endif #if \ defined(__cplusplus) && \ - (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ - !defined(HEDLEY_PGI_VERSION) + (!defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) || NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) #if \ (__cplusplus >= 201703L) || \ - ((__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) - #define HEDLEY_FALL_THROUGH [[fallthrough]] - #elif (__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) - #define HEDLEY_FALL_THROUGH [[clang::fallthrough]] - #elif (__cplusplus >= 201103L) && HEDLEY_GCC_VERSION_CHECK(7,0,0) - #define HEDLEY_FALL_THROUGH [[gnu::fallthrough]] + ((__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[fallthrough]] + #elif (__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[clang::fallthrough]] + #elif (__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[gnu::fallthrough]] #endif #endif -#if !defined(HEDLEY_FALL_THROUGH) - #if HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(HEDLEY_PGI_VERSION) - #define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#if !defined(NLOHMANN_JSON_HEDLEY_FALL_THROUGH) + #if NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) #elif defined(__fallthrough) /* SAL */ - #define HEDLEY_FALL_THROUGH __fallthrough + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH __fallthrough #else - #define HEDLEY_FALL_THROUGH + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH #endif #endif -#if defined(HEDLEY_RETURNS_NON_NULL) - #undef HEDLEY_RETURNS_NON_NULL +#if defined(NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL) + #undef NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL #endif #if \ - HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ - HEDLEY_GCC_VERSION_CHECK(4,9,0) - #define HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) #elif defined(_Ret_notnull_) /* SAL */ - #define HEDLEY_RETURNS_NON_NULL _Ret_notnull_ + #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ #else - #define HEDLEY_RETURNS_NON_NULL + #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL #endif -#if defined(HEDLEY_ARRAY_PARAM) - #undef HEDLEY_ARRAY_PARAM +#if defined(NLOHMANN_JSON_HEDLEY_ARRAY_PARAM) + #undef NLOHMANN_JSON_HEDLEY_ARRAY_PARAM #endif #if \ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ !defined(__STDC_NO_VLA__) && \ !defined(__cplusplus) && \ - !defined(HEDLEY_PGI_VERSION) && \ - !defined(HEDLEY_TINYC_VERSION) - #define HEDLEY_ARRAY_PARAM(name) (name) + !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) + #define NLOHMANN_JSON_HEDLEY_ARRAY_PARAM(name) (name) #else - #define HEDLEY_ARRAY_PARAM(name) + #define NLOHMANN_JSON_HEDLEY_ARRAY_PARAM(name) #endif -#if defined(HEDLEY_IS_CONSTANT) - #undef HEDLEY_IS_CONSTANT +#if defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) + #undef NLOHMANN_JSON_HEDLEY_IS_CONSTANT #endif -#if defined(HEDLEY_REQUIRE_CONSTEXPR) - #undef HEDLEY_REQUIRE_CONSTEXPR +#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR #endif /* Note the double-underscore. For internal use only; no API * guarantees! */ -#if defined(HEDLEY__IS_CONSTEXPR) - #undef HEDLEY__IS_CONSTEXPR +#if defined(NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR) + #undef NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR #endif #if \ - HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ - HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - HEDLEY_TI_VERSION_CHECK(6,1,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ - HEDLEY_CRAY_VERSION_CHECK(8,1,0) - #define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) + NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ + NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) #endif #if !defined(__cplusplus) # if \ - HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ - HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,24) + NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) #if defined(__INTPTR_TYPE__) - #define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) + #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) #else #include - #define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) + #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) #endif # elif \ - (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(HEDLEY_SUNPRO_VERSION) && !defined(HEDLEY_PGI_VERSION)) || \ - HEDLEY_HAS_EXTENSION(c_generic_selections) || \ - HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ - HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ - HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,3,0) + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) && !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION)) || \ + NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) #if defined(__INTPTR_TYPE__) - #define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) + #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) #else #include - #define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) + #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) #endif # elif \ - defined(HEDLEY_GCC_VERSION) || \ - defined(HEDLEY_INTEL_VERSION) || \ - defined(HEDLEY_TINYC_VERSION) || \ - defined(HEDLEY_TI_VERSION) || \ + defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) || \ + defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) || \ + defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) || \ + defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) || \ defined(__clang__) -# define HEDLEY__IS_CONSTEXPR(expr) ( \ +# define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) ( \ sizeof(void) != \ sizeof(*( \ 1 ? \ @@ -1268,238 +1268,238 @@ HEDLEY_DIAGNOSTIC_POP ((struct { char v[sizeof(void) * 2]; } *) 1) \ ) \ ) \ - ) + ) # endif #endif -#if defined(HEDLEY__IS_CONSTEXPR) - #if !defined(HEDLEY_IS_CONSTANT) - #define HEDLEY_IS_CONSTANT(expr) HEDLEY__IS_CONSTEXPR(expr) +#if defined(NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR) + #if !defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) + #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) #endif - #define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) + #define NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) #else - #if !defined(HEDLEY_IS_CONSTANT) - #define HEDLEY_IS_CONSTANT(expr) (0) + #if !defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) + #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) (0) #endif - #define HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) + #define NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) #endif -#if defined(HEDLEY_BEGIN_C_DECLS) - #undef HEDLEY_BEGIN_C_DECLS +#if defined(NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS) + #undef NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS #endif -#if defined(HEDLEY_END_C_DECLS) - #undef HEDLEY_END_C_DECLS +#if defined(NLOHMANN_JSON_HEDLEY_END_C_DECLS) + #undef NLOHMANN_JSON_HEDLEY_END_C_DECLS #endif -#if defined(HEDLEY_C_DECL) - #undef HEDLEY_C_DECL +#if defined(NLOHMANN_JSON_HEDLEY_C_DECL) + #undef NLOHMANN_JSON_HEDLEY_C_DECL #endif #if defined(__cplusplus) - #define HEDLEY_BEGIN_C_DECLS extern "C" { - #define HEDLEY_END_C_DECLS } - #define HEDLEY_C_DECL extern "C" + #define NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define NLOHMANN_JSON_HEDLEY_END_C_DECLS } + #define NLOHMANN_JSON_HEDLEY_C_DECL extern "C" #else - #define HEDLEY_BEGIN_C_DECLS - #define HEDLEY_END_C_DECLS - #define HEDLEY_C_DECL + #define NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS + #define NLOHMANN_JSON_HEDLEY_END_C_DECLS + #define NLOHMANN_JSON_HEDLEY_C_DECL #endif -#if defined(HEDLEY_STATIC_ASSERT) - #undef HEDLEY_STATIC_ASSERT +#if defined(NLOHMANN_JSON_HEDLEY_STATIC_ASSERT) + #undef NLOHMANN_JSON_HEDLEY_STATIC_ASSERT #endif #if \ !defined(__cplusplus) && ( \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ - HEDLEY_HAS_FEATURE(c_static_assert) || \ - HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ defined(_Static_assert) \ ) -# define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) #elif \ (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ - HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ - (defined(__cplusplus) && HEDLEY_TI_VERSION_CHECK(8,3,0)) -# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + (defined(__cplusplus) && NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,3,0)) +# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) #elif defined(__cplusplus) && (__cplusplus >= 201103L) -# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) +# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) #else -# define HEDLEY_STATIC_ASSERT(expr, message) +# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) #endif -#if defined(HEDLEY_CONST_CAST) - #undef HEDLEY_CONST_CAST +#if defined(NLOHMANN_JSON_HEDLEY_CONST_CAST) + #undef NLOHMANN_JSON_HEDLEY_CONST_CAST #endif #if defined(__cplusplus) -# define HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) #elif \ - HEDLEY_HAS_WARNING("-Wcast-qual") || \ - HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) -# define HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ - HEDLEY_DIAGNOSTIC_PUSH \ - HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ ((T) (expr)); \ - HEDLEY_DIAGNOSTIC_POP \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP \ })) #else -# define HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) #endif -#if defined(HEDLEY_REINTERPRET_CAST) - #undef HEDLEY_REINTERPRET_CAST +#if defined(NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST) + #undef NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST #endif #if defined(__cplusplus) - #define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) + #define NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) #else - #define HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) + #define NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) #endif -#if defined(HEDLEY_STATIC_CAST) - #undef HEDLEY_STATIC_CAST +#if defined(NLOHMANN_JSON_HEDLEY_STATIC_CAST) + #undef NLOHMANN_JSON_HEDLEY_STATIC_CAST #endif #if defined(__cplusplus) - #define HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) + #define NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) #else - #define HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) + #define NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) #endif -#if defined(HEDLEY_CPP_CAST) - #undef HEDLEY_CPP_CAST +#if defined(NLOHMANN_JSON_HEDLEY_CPP_CAST) + #undef NLOHMANN_JSON_HEDLEY_CPP_CAST #endif #if defined(__cplusplus) - #define HEDLEY_CPP_CAST(T, expr) static_cast(expr) + #define NLOHMANN_JSON_HEDLEY_CPP_CAST(T, expr) static_cast(expr) #else - #define HEDLEY_CPP_CAST(T, expr) (expr) + #define NLOHMANN_JSON_HEDLEY_CPP_CAST(T, expr) (expr) #endif -#if defined(HEDLEY_MESSAGE) - #undef HEDLEY_MESSAGE +#if defined(NLOHMANN_JSON_HEDLEY_MESSAGE) + #undef NLOHMANN_JSON_HEDLEY_MESSAGE #endif -#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") -# define HEDLEY_MESSAGE(msg) \ - HEDLEY_DIAGNOSTIC_PUSH \ - HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - HEDLEY_PRAGMA(message msg) \ - HEDLEY_DIAGNOSTIC_POP +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + NLOHMANN_JSON_HEDLEY_PRAGMA(message msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP #elif \ - HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) -# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message msg) -#elif HEDLEY_CRAY_VERSION_CHECK(5,0,0) -# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(_CRI message msg) -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) -# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) -#elif HEDLEY_PELLES_VERSION_CHECK(2,0,0) -# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message msg) +#elif NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) #else -# define HEDLEY_MESSAGE(msg) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) #endif -#if defined(HEDLEY_WARNING) - #undef HEDLEY_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_WARNING) + #undef NLOHMANN_JSON_HEDLEY_WARNING #endif -#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") -# define HEDLEY_WARNING(msg) \ - HEDLEY_DIAGNOSTIC_PUSH \ - HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - HEDLEY_PRAGMA(clang warning msg) \ - HEDLEY_DIAGNOSTIC_POP +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define NLOHMANN_JSON_HEDLEY_WARNING(msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + NLOHMANN_JSON_HEDLEY_PRAGMA(clang warning msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP #elif \ - HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ - HEDLEY_PGI_VERSION_CHECK(18,4,0) -# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg) -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) -# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg)) + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) +# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) #else -# define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg) +# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_MESSAGE(msg) #endif -#if defined(HEDLEY_REQUIRE_MSG) - #undef HEDLEY_REQUIRE_MSG +#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE_MSG) + #undef NLOHMANN_JSON_HEDLEY_REQUIRE_MSG #endif -#if HEDLEY_HAS_ATTRIBUTE(diagnose_if) -# if HEDLEY_HAS_WARNING("-Wgcc-compat") -# define HEDLEY_REQUIRE_MSG(expr, msg) \ - HEDLEY_DIAGNOSTIC_PUSH \ +#if NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ __attribute__((__diagnose_if__(!(expr), msg, "error"))) \ - HEDLEY_DIAGNOSTIC_POP + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP # else -# define HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) +# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) # endif #else -# define HEDLEY_REQUIRE_MSG(expr, msg) +# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) #endif -#if defined(HEDLEY_REQUIRE) - #undef HEDLEY_REQUIRE +#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE) + #undef NLOHMANN_JSON_HEDLEY_REQUIRE #endif -#define HEDLEY_REQUIRE(expr) HEDLEY_REQUIRE_MSG(expr, #expr) +#define NLOHMANN_JSON_HEDLEY_REQUIRE(expr) NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, #expr) -#if defined(HEDLEY_FLAGS) - #undef HEDLEY_FLAGS +#if defined(NLOHMANN_JSON_HEDLEY_FLAGS) + #undef NLOHMANN_JSON_HEDLEY_FLAGS #endif -#if HEDLEY_HAS_ATTRIBUTE(flag_enum) - #define HEDLEY_FLAGS __attribute__((__flag_enum__)) +#if NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define NLOHMANN_JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) #endif -#if defined(HEDLEY_FLAGS_CAST) - #undef HEDLEY_FLAGS_CAST +#if defined(NLOHMANN_JSON_HEDLEY_FLAGS_CAST) + #undef NLOHMANN_JSON_HEDLEY_FLAGS_CAST #endif -#if HEDLEY_INTEL_VERSION_CHECK(19,0,0) -# define HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ - HEDLEY_DIAGNOSTIC_PUSH \ +#if NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define NLOHMANN_JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("warning(disable:188)") \ ((T) (expr)); \ - HEDLEY_DIAGNOSTIC_POP \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP \ })) #else -# define HEDLEY_FLAGS_CAST(T, expr) HEDLEY_STATIC_CAST(T, expr) +# define NLOHMANN_JSON_HEDLEY_FLAGS_CAST(T, expr) NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) #endif /* Remaining macros are deprecated. */ -#if defined(HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) - #undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK #endif #if defined(__clang__) - #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) #else - #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_CLANG_HAS_ATTRIBUTE) - #undef HEDLEY_CLANG_HAS_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE #endif -#define HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) HEDLEY_HAS_ATTRIBUTE(attribute) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) -#if defined(HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) - #undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE #endif -#define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) HEDLEY_HAS_CPP_ATTRIBUTE(attribute) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) -#if defined(HEDLEY_CLANG_HAS_BUILTIN) - #undef HEDLEY_CLANG_HAS_BUILTIN +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN #endif -#define HEDLEY_CLANG_HAS_BUILTIN(builtin) HEDLEY_HAS_BUILTIN(builtin) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) -#if defined(HEDLEY_CLANG_HAS_FEATURE) - #undef HEDLEY_CLANG_HAS_FEATURE +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE #endif -#define HEDLEY_CLANG_HAS_FEATURE(feature) HEDLEY_HAS_FEATURE(feature) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE(feature) NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) -#if defined(HEDLEY_CLANG_HAS_EXTENSION) - #undef HEDLEY_CLANG_HAS_EXTENSION +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION #endif -#define HEDLEY_CLANG_HAS_EXTENSION(extension) HEDLEY_HAS_EXTENSION(extension) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) -#if defined(HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) - #undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE #endif -#define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) -#if defined(HEDLEY_CLANG_HAS_WARNING) - #undef HEDLEY_CLANG_HAS_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING #endif -#define HEDLEY_CLANG_HAS_WARNING(warning) HEDLEY_HAS_WARNING(warning) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING(warning) NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) -#endif /* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */ +#endif /* !defined(NLOHMANN_JSON_HEDLEY_VERSION) || (NLOHMANN_JSON_HEDLEY_VERSION < X) */ diff --git a/include/nlohmann/thirdparty/hedley/hedley_undef.hpp b/include/nlohmann/thirdparty/hedley/hedley_undef.hpp new file mode 100644 index 00000000..5458f064 --- /dev/null +++ b/include/nlohmann/thirdparty/hedley/hedley_undef.hpp @@ -0,0 +1,122 @@ +#undef NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE +#undef NLOHMANN_JSON_HEDLEY_ARM_VERSION +#undef NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_ARRAY_PARAM +#undef NLOHMANN_JSON_HEDLEY_ASSUME +#undef NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING +#undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION +#undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_CONCAT +#undef NLOHMANN_JSON_HEDLEY_CONCAT_EX +#undef NLOHMANN_JSON_HEDLEY_CONST +#undef NLOHMANN_JSON_HEDLEY_CONSTEXPR +#undef NLOHMANN_JSON_HEDLEY_CONST_CAST +#undef NLOHMANN_JSON_HEDLEY_CPP_CAST +#undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION +#undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_C_DECL +#undef NLOHMANN_JSON_HEDLEY_DEPRECATED +#undef NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH +#undef NLOHMANN_JSON_HEDLEY_DMC_VERSION +#undef NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION +#undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_END_C_DECLS +#undef NLOHMANN_JSON_HEDLEY_FALL_THROUGH +#undef NLOHMANN_JSON_HEDLEY_FLAGS +#undef NLOHMANN_JSON_HEDLEY_FLAGS_CAST +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING +#undef NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_GCC_VERSION +#undef NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING +#undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION +#undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_HAS_BUILTIN +#undef NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_HAS_EXTENSION +#undef NLOHMANN_JSON_HEDLEY_HAS_FEATURE +#undef NLOHMANN_JSON_HEDLEY_HAS_WARNING +#undef NLOHMANN_JSON_HEDLEY_IAR_VERSION +#undef NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_IBM_VERSION +#undef NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_IMPORT +#undef NLOHMANN_JSON_HEDLEY_INLINE +#undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION +#undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_IS_CONSTANT +#undef NLOHMANN_JSON_HEDLEY_LIKELY +#undef NLOHMANN_JSON_HEDLEY_MALLOC +#undef NLOHMANN_JSON_HEDLEY_MESSAGE +#undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION +#undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_NEVER_INLINE +#undef NLOHMANN_JSON_HEDLEY_NON_NULL +#undef NLOHMANN_JSON_HEDLEY_NO_RETURN +#undef NLOHMANN_JSON_HEDLEY_NO_THROW +#undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION +#undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_PGI_VERSION +#undef NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_PREDICT +#undef NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT +#undef NLOHMANN_JSON_HEDLEY_PRIVATE +#undef NLOHMANN_JSON_HEDLEY_PUBLIC +#undef NLOHMANN_JSON_HEDLEY_PURE +#undef NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST +#undef NLOHMANN_JSON_HEDLEY_REQUIRE +#undef NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR +#undef NLOHMANN_JSON_HEDLEY_REQUIRE_MSG +#undef NLOHMANN_JSON_HEDLEY_RESTRICT +#undef NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +#undef NLOHMANN_JSON_HEDLEY_SENTINEL +#undef NLOHMANN_JSON_HEDLEY_STATIC_ASSERT +#undef NLOHMANN_JSON_HEDLEY_STATIC_CAST +#undef NLOHMANN_JSON_HEDLEY_STRINGIFY +#undef NLOHMANN_JSON_HEDLEY_STRINGIFY_EX +#undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION +#undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION +#undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_TI_VERSION +#undef NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_UNAVAILABLE +#undef NLOHMANN_JSON_HEDLEY_UNLIKELY +#undef NLOHMANN_JSON_HEDLEY_UNPREDICTABLE +#undef NLOHMANN_JSON_HEDLEY_UNREACHABLE +#undef NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN +#undef NLOHMANN_JSON_HEDLEY_VERSION +#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR +#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR +#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION +#undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE +#undef NLOHMANN_JSON_HEDLEY_WARNING +#undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT +#undef NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 32ce6dff..73a53ffb 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -122,1257 +122,1257 @@ struct position_t * SPDX-License-Identifier: CC0-1.0 */ -#if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 9) -#if defined(HEDLEY_VERSION) - #undef HEDLEY_VERSION +#if !defined(NLOHMANN_JSON_HEDLEY_VERSION) || (NLOHMANN_JSON_HEDLEY_VERSION < 9) +#if defined(NLOHMANN_JSON_HEDLEY_VERSION) + #undef NLOHMANN_JSON_HEDLEY_VERSION #endif -#define HEDLEY_VERSION 9 +#define NLOHMANN_JSON_HEDLEY_VERSION 9 -#if defined(HEDLEY_STRINGIFY_EX) - #undef HEDLEY_STRINGIFY_EX +#if defined(NLOHMANN_JSON_HEDLEY_STRINGIFY_EX) + #undef NLOHMANN_JSON_HEDLEY_STRINGIFY_EX #endif -#define HEDLEY_STRINGIFY_EX(x) #x +#define NLOHMANN_JSON_HEDLEY_STRINGIFY_EX(x) #x -#if defined(HEDLEY_STRINGIFY) - #undef HEDLEY_STRINGIFY +#if defined(NLOHMANN_JSON_HEDLEY_STRINGIFY) + #undef NLOHMANN_JSON_HEDLEY_STRINGIFY #endif -#define HEDLEY_STRINGIFY(x) HEDLEY_STRINGIFY_EX(x) +#define NLOHMANN_JSON_HEDLEY_STRINGIFY(x) NLOHMANN_JSON_HEDLEY_STRINGIFY_EX(x) -#if defined(HEDLEY_CONCAT_EX) - #undef HEDLEY_CONCAT_EX +#if defined(NLOHMANN_JSON_HEDLEY_CONCAT_EX) + #undef NLOHMANN_JSON_HEDLEY_CONCAT_EX #endif -#define HEDLEY_CONCAT_EX(a,b) a##b +#define NLOHMANN_JSON_HEDLEY_CONCAT_EX(a,b) a##b -#if defined(HEDLEY_CONCAT) - #undef HEDLEY_CONCAT +#if defined(NLOHMANN_JSON_HEDLEY_CONCAT) + #undef NLOHMANN_JSON_HEDLEY_CONCAT #endif -#define HEDLEY_CONCAT(a,b) HEDLEY_CONCAT_EX(a,b) +#define NLOHMANN_JSON_HEDLEY_CONCAT(a,b) NLOHMANN_JSON_HEDLEY_CONCAT_EX(a,b) -#if defined(HEDLEY_VERSION_ENCODE) - #undef HEDLEY_VERSION_ENCODE +#if defined(NLOHMANN_JSON_HEDLEY_VERSION_ENCODE) + #undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE #endif -#define HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) +#define NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) -#if defined(HEDLEY_VERSION_DECODE_MAJOR) - #undef HEDLEY_VERSION_DECODE_MAJOR +#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR #endif -#define HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) +#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) -#if defined(HEDLEY_VERSION_DECODE_MINOR) - #undef HEDLEY_VERSION_DECODE_MINOR +#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR #endif -#define HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) +#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) -#if defined(HEDLEY_VERSION_DECODE_REVISION) - #undef HEDLEY_VERSION_DECODE_REVISION +#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION #endif -#define HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) +#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) -#if defined(HEDLEY_GNUC_VERSION) - #undef HEDLEY_GNUC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION #endif #if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) - #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) + #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) #elif defined(__GNUC__) - #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) + #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) #endif -#if defined(HEDLEY_GNUC_VERSION_CHECK) - #undef HEDLEY_GNUC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK #endif -#if defined(HEDLEY_GNUC_VERSION) - #define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (HEDLEY_GNUC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) + #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_GNUC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_MSVC_VERSION) - #undef HEDLEY_MSVC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_MSVC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION #endif #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) - #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) #elif defined(_MSC_FULL_VER) - #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) #elif defined(_MSC_VER) - #define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) #endif -#if defined(HEDLEY_MSVC_VERSION_CHECK) - #undef HEDLEY_MSVC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK #endif #if !defined(_MSC_VER) - #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) #elif defined(_MSC_VER) && (_MSC_VER >= 1400) - #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) #elif defined(_MSC_VER) && (_MSC_VER >= 1200) - #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) #else - #define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) + #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) #endif -#if defined(HEDLEY_INTEL_VERSION) - #undef HEDLEY_INTEL_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) + #undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION #endif #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) - #define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) + #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) #elif defined(__INTEL_COMPILER) - #define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) + #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) #endif -#if defined(HEDLEY_INTEL_VERSION_CHECK) - #undef HEDLEY_INTEL_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK #endif -#if defined(HEDLEY_INTEL_VERSION) - #define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (HEDLEY_INTEL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) + #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_INTEL_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_PGI_VERSION) - #undef HEDLEY_PGI_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) + #undef NLOHMANN_JSON_HEDLEY_PGI_VERSION #endif #if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) - #define HEDLEY_PGI_VERSION HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) + #define NLOHMANN_JSON_HEDLEY_PGI_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) #endif -#if defined(HEDLEY_PGI_VERSION_CHECK) - #undef HEDLEY_PGI_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK #endif -#if defined(HEDLEY_PGI_VERSION) - #define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (HEDLEY_PGI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) + #define NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_PGI_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_SUNPRO_VERSION) - #undef HEDLEY_SUNPRO_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) + #undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION #endif #if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) - #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) #elif defined(__SUNPRO_C) - #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) #elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) - #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) #elif defined(__SUNPRO_CC) - #define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) #endif -#if defined(HEDLEY_SUNPRO_VERSION_CHECK) - #undef HEDLEY_SUNPRO_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK #endif -#if defined(HEDLEY_SUNPRO_VERSION) - #define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (HEDLEY_SUNPRO_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_EMSCRIPTEN_VERSION) - #undef HEDLEY_EMSCRIPTEN_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION #endif #if defined(__EMSCRIPTEN__) - #define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) + #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) #endif -#if defined(HEDLEY_EMSCRIPTEN_VERSION_CHECK) - #undef HEDLEY_EMSCRIPTEN_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK #endif -#if defined(HEDLEY_EMSCRIPTEN_VERSION) - #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (HEDLEY_EMSCRIPTEN_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_ARM_VERSION) - #undef HEDLEY_ARM_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) + #undef NLOHMANN_JSON_HEDLEY_ARM_VERSION #endif #if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) - #define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) + #define NLOHMANN_JSON_HEDLEY_ARM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) #elif defined(__CC_ARM) && defined(__ARMCC_VERSION) - #define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) + #define NLOHMANN_JSON_HEDLEY_ARM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) #endif -#if defined(HEDLEY_ARM_VERSION_CHECK) - #undef HEDLEY_ARM_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK #endif -#if defined(HEDLEY_ARM_VERSION) - #define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (HEDLEY_ARM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) + #define NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_ARM_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_IBM_VERSION) - #undef HEDLEY_IBM_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION) + #undef NLOHMANN_JSON_HEDLEY_IBM_VERSION #endif #if defined(__ibmxl__) - #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) #elif defined(__xlC__) && defined(__xlC_ver__) - #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) #elif defined(__xlC__) - #define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) #endif -#if defined(HEDLEY_IBM_VERSION_CHECK) - #undef HEDLEY_IBM_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK #endif -#if defined(HEDLEY_IBM_VERSION) - #define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (HEDLEY_IBM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_IBM_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_TI_VERSION) - #undef HEDLEY_TI_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) + #undef NLOHMANN_JSON_HEDLEY_TI_VERSION #endif #if defined(__TI_COMPILER_VERSION__) - #define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) + #define NLOHMANN_JSON_HEDLEY_TI_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) #endif -#if defined(HEDLEY_TI_VERSION_CHECK) - #undef HEDLEY_TI_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK #endif -#if defined(HEDLEY_TI_VERSION) - #define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) + #define NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_TI_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_CRAY_VERSION) - #undef HEDLEY_CRAY_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION) + #undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION #endif #if defined(_CRAYC) #if defined(_RELEASE_PATCHLEVEL) - #define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) #else - #define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) #endif #endif -#if defined(HEDLEY_CRAY_VERSION_CHECK) - #undef HEDLEY_CRAY_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK #endif -#if defined(HEDLEY_CRAY_VERSION) - #define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (HEDLEY_CRAY_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION) + #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_CRAY_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_IAR_VERSION) - #undef HEDLEY_IAR_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION) + #undef NLOHMANN_JSON_HEDLEY_IAR_VERSION #endif #if defined(__IAR_SYSTEMS_ICC__) #if __VER__ > 1000 - #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #define NLOHMANN_JSON_HEDLEY_IAR_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) #else - #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #define NLOHMANN_JSON_HEDLEY_IAR_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) #endif #endif -#if defined(HEDLEY_IAR_VERSION_CHECK) - #undef HEDLEY_IAR_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK #endif -#if defined(HEDLEY_IAR_VERSION) - #define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (HEDLEY_IAR_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION) + #define NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_IAR_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_TINYC_VERSION) - #undef HEDLEY_TINYC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION #endif #if defined(__TINYC__) - #define HEDLEY_TINYC_VERSION HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) + #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) #endif -#if defined(HEDLEY_TINYC_VERSION_CHECK) - #undef HEDLEY_TINYC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK #endif -#if defined(HEDLEY_TINYC_VERSION) - #define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (HEDLEY_TINYC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) + #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_TINYC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_DMC_VERSION) - #undef HEDLEY_DMC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_DMC_VERSION #endif #if defined(__DMC__) - #define HEDLEY_DMC_VERSION HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) + #define NLOHMANN_JSON_HEDLEY_DMC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) #endif -#if defined(HEDLEY_DMC_VERSION_CHECK) - #undef HEDLEY_DMC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK #endif -#if defined(HEDLEY_DMC_VERSION) - #define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (HEDLEY_DMC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION) + #define NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_DMC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_COMPCERT_VERSION) - #undef HEDLEY_COMPCERT_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION) + #undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION #endif #if defined(__COMPCERT_VERSION__) - #define HEDLEY_COMPCERT_VERSION HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) + #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) #endif -#if defined(HEDLEY_COMPCERT_VERSION_CHECK) - #undef HEDLEY_COMPCERT_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK #endif -#if defined(HEDLEY_COMPCERT_VERSION) - #define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (HEDLEY_COMPCERT_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION) + #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_PELLES_VERSION) - #undef HEDLEY_PELLES_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION) + #undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION #endif #if defined(__POCC__) - #define HEDLEY_PELLES_VERSION HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) + #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) #endif -#if defined(HEDLEY_PELLES_VERSION_CHECK) - #undef HEDLEY_PELLES_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK #endif -#if defined(HEDLEY_PELLES_VERSION) - #define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (HEDLEY_PELLES_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION) + #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_PELLES_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_GCC_VERSION) - #undef HEDLEY_GCC_VERSION +#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) + #undef NLOHMANN_JSON_HEDLEY_GCC_VERSION #endif #if \ - defined(HEDLEY_GNUC_VERSION) && \ + defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) && \ !defined(__clang__) && \ - !defined(HEDLEY_INTEL_VERSION) && \ - !defined(HEDLEY_PGI_VERSION) && \ - !defined(HEDLEY_ARM_VERSION) && \ - !defined(HEDLEY_TI_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) && \ !defined(__COMPCERT__) - #define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION + #define NLOHMANN_JSON_HEDLEY_GCC_VERSION NLOHMANN_JSON_HEDLEY_GNUC_VERSION #endif -#if defined(HEDLEY_GCC_VERSION_CHECK) - #undef HEDLEY_GCC_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK #endif -#if defined(HEDLEY_GCC_VERSION) - #define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (HEDLEY_GCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) + #define NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_GCC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(HEDLEY_HAS_ATTRIBUTE) - #undef HEDLEY_HAS_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) #else - #define HEDLEY_HAS_ATTRIBUTE(attribute) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) #endif -#if defined(HEDLEY_GNUC_HAS_ATTRIBUTE) - #undef HEDLEY_GNUC_HAS_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) #else - #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_ATTRIBUTE) - #undef HEDLEY_GCC_HAS_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) #else - #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_CPP_ATTRIBUTE) - #undef HEDLEY_HAS_CPP_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) #else - #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) #endif -#if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) - #undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) #else - #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_CPP_ATTRIBUTE) - #undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) #else - #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_BUILTIN) - #undef HEDLEY_HAS_BUILTIN +#if defined(NLOHMANN_JSON_HEDLEY_HAS_BUILTIN) + #undef NLOHMANN_JSON_HEDLEY_HAS_BUILTIN #endif #if defined(__has_builtin) - #define HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) + #define NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) #else - #define HEDLEY_HAS_BUILTIN(builtin) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) (0) #endif -#if defined(HEDLEY_GNUC_HAS_BUILTIN) - #undef HEDLEY_GNUC_HAS_BUILTIN +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN #endif #if defined(__has_builtin) - #define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) #else - #define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_BUILTIN) - #undef HEDLEY_GCC_HAS_BUILTIN +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN #endif #if defined(__has_builtin) - #define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) #else - #define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_FEATURE) - #undef HEDLEY_HAS_FEATURE +#if defined(NLOHMANN_JSON_HEDLEY_HAS_FEATURE) + #undef NLOHMANN_JSON_HEDLEY_HAS_FEATURE #endif #if defined(__has_feature) - #define HEDLEY_HAS_FEATURE(feature) __has_feature(feature) + #define NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) #else - #define HEDLEY_HAS_FEATURE(feature) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) (0) #endif -#if defined(HEDLEY_GNUC_HAS_FEATURE) - #undef HEDLEY_GNUC_HAS_FEATURE +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE #endif #if defined(__has_feature) - #define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) #else - #define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_FEATURE) - #undef HEDLEY_GCC_HAS_FEATURE +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE #endif #if defined(__has_feature) - #define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) #else - #define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_EXTENSION) - #undef HEDLEY_HAS_EXTENSION +#if defined(NLOHMANN_JSON_HEDLEY_HAS_EXTENSION) + #undef NLOHMANN_JSON_HEDLEY_HAS_EXTENSION #endif #if defined(__has_extension) - #define HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) + #define NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) #else - #define HEDLEY_HAS_EXTENSION(extension) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) (0) #endif -#if defined(HEDLEY_GNUC_HAS_EXTENSION) - #undef HEDLEY_GNUC_HAS_EXTENSION +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION #endif #if defined(__has_extension) - #define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) #else - #define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_EXTENSION) - #undef HEDLEY_GCC_HAS_EXTENSION +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION #endif #if defined(__has_extension) - #define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) #else - #define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_DECLSPEC_ATTRIBUTE) - #undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) #else - #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) #endif -#if defined(HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) - #undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) #else - #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) - #undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) #else - #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_HAS_WARNING) - #undef HEDLEY_HAS_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_HAS_WARNING) + #undef NLOHMANN_JSON_HEDLEY_HAS_WARNING #endif #if defined(__has_warning) - #define HEDLEY_HAS_WARNING(warning) __has_warning(warning) + #define NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) #else - #define HEDLEY_HAS_WARNING(warning) (0) + #define NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) (0) #endif -#if defined(HEDLEY_GNUC_HAS_WARNING) - #undef HEDLEY_GNUC_HAS_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING) + #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING #endif #if defined(__has_warning) - #define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) #else - #define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_GCC_HAS_WARNING) - #undef HEDLEY_GCC_HAS_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING) + #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING #endif #if defined(__has_warning) - #define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) #else - #define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif #if \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ defined(__clang__) || \ - HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ - HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_TI_VERSION_CHECK(6,0,0) || \ - HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ - HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ - (HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) - #define HEDLEY_PRAGMA(value) _Pragma(#value) -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define HEDLEY_PRAGMA(value) __pragma(value) + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) || \ + NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) __pragma(value) #else - #define HEDLEY_PRAGMA(value) + #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) #endif -#if defined(HEDLEY_DIAGNOSTIC_PUSH) - #undef HEDLEY_DIAGNOSTIC_PUSH +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH #endif -#if defined(HEDLEY_DIAGNOSTIC_POP) - #undef HEDLEY_DIAGNOSTIC_POP +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP #endif #if defined(__clang__) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") -#elif HEDLEY_GCC_VERSION_CHECK(4,6,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) - #define HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) -#elif HEDLEY_ARM_VERSION_CHECK(5,6,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("pop") -#elif HEDLEY_TI_VERSION_CHECK(8,1,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") -#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) - #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") - #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,1,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") #else - #define HEDLEY_DIAGNOSTIC_PUSH - #define HEDLEY_DIAGNOSTIC_POP + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP #endif -#if defined(HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) - #undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED #endif -#if HEDLEY_HAS_WARNING("-Wdeprecated-declarations") - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") -#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") -#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) -#elif HEDLEY_TI_VERSION_CHECK(8,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") -#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") -#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") -#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") #else - #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED #endif -#if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) - #undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS #endif -#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") -#elif HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") -#elif HEDLEY_GCC_VERSION_CHECK(4,3,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) -#elif HEDLEY_TI_VERSION_CHECK(8,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") #else - #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS #endif -#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) - #undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL #endif -#if HEDLEY_HAS_WARNING("-Wcast-qual") - #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") -#elif HEDLEY_GCC_VERSION_CHECK(3,0,0) - #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") #else - #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL + #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL #endif -#if defined(HEDLEY_DEPRECATED) - #undef HEDLEY_DEPRECATED +#if defined(NLOHMANN_JSON_HEDLEY_DEPRECATED) + #undef NLOHMANN_JSON_HEDLEY_DEPRECATED #endif -#if defined(HEDLEY_DEPRECATED_FOR) - #undef HEDLEY_DEPRECATED_FOR +#if defined(NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR) + #undef NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR #endif #if defined(__cplusplus) && (__cplusplus >= 201402L) - #define HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] - #define HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] #elif \ - HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ - HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ - HEDLEY_TI_VERSION_CHECK(8,3,0) - #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) - #define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) + NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,3,0) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) #elif \ - HEDLEY_HAS_ATTRIBUTE(deprecated) || \ - HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) - #define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) -#elif HEDLEY_MSVC_VERSION_CHECK(14,0,0) - #define HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) - #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) #elif \ - HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ - HEDLEY_PELLES_VERSION_CHECK(6,50,0) - #define HEDLEY_DEPRECATED(since) _declspec(deprecated) - #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_DEPRECATED(since) _Pragma("deprecated") - #define HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) _declspec(deprecated) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") #else - #define HEDLEY_DEPRECATED(since) - #define HEDLEY_DEPRECATED_FOR(since, replacement) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) + #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) #endif -#if defined(HEDLEY_UNAVAILABLE) - #undef HEDLEY_UNAVAILABLE +#if defined(NLOHMANN_JSON_HEDLEY_UNAVAILABLE) + #undef NLOHMANN_JSON_HEDLEY_UNAVAILABLE #endif #if \ - HEDLEY_HAS_ATTRIBUTE(warning) || \ - HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) #else - #define HEDLEY_UNAVAILABLE(available_since) + #define NLOHMANN_JSON_HEDLEY_UNAVAILABLE(available_since) #endif -#if defined(HEDLEY_WARN_UNUSED_RESULT) - #undef HEDLEY_WARN_UNUSED_RESULT +#if defined(NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT #endif #if defined(__cplusplus) && (__cplusplus >= 201703L) - #define HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] + #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] #elif \ - HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ - HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) #elif defined(_Check_return_) /* SAL */ - #define HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ #else - #define HEDLEY_WARN_UNUSED_RESULT + #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT #endif -#if defined(HEDLEY_SENTINEL) - #undef HEDLEY_SENTINEL +#if defined(NLOHMANN_JSON_HEDLEY_SENTINEL) + #undef NLOHMANN_JSON_HEDLEY_SENTINEL #endif #if \ - HEDLEY_HAS_ATTRIBUTE(sentinel) || \ - HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,4,0) - #define HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define NLOHMANN_JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) #else - #define HEDLEY_SENTINEL(position) + #define NLOHMANN_JSON_HEDLEY_SENTINEL(position) #endif -#if defined(HEDLEY_NO_RETURN) - #undef HEDLEY_NO_RETURN +#if defined(NLOHMANN_JSON_HEDLEY_NO_RETURN) + #undef NLOHMANN_JSON_HEDLEY_NO_RETURN #endif -#if HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_NO_RETURN __noreturn -#elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#if NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __noreturn +#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - #define HEDLEY_NO_RETURN _Noreturn + #define NLOHMANN_JSON_HEDLEY_NO_RETURN _Noreturn #elif defined(__cplusplus) && (__cplusplus >= 201103L) - #define HEDLEY_NO_RETURN [[noreturn]] + #define NLOHMANN_JSON_HEDLEY_NO_RETURN [[noreturn]] #elif \ - HEDLEY_HAS_ATTRIBUTE(noreturn) || \ - HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(18,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_NO_RETURN __attribute__((__noreturn__)) -#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define HEDLEY_NO_RETURN __declspec(noreturn) -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") -#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) - #define HEDLEY_NO_RETURN __attribute((noreturn)) -#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) - #define HEDLEY_NO_RETURN __declspec(noreturn) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(18,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define NLOHMANN_JSON_HEDLEY_NO_RETURN __declspec(noreturn) #else - #define HEDLEY_NO_RETURN + #define NLOHMANN_JSON_HEDLEY_NO_RETURN #endif -#if defined(HEDLEY_UNREACHABLE) - #undef HEDLEY_UNREACHABLE +#if defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE) + #undef NLOHMANN_JSON_HEDLEY_UNREACHABLE #endif -#if defined(HEDLEY_UNREACHABLE_RETURN) - #undef HEDLEY_UNREACHABLE_RETURN +#if defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN) + #undef NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN #endif #if \ - (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) || \ - HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,5) - #define HEDLEY_UNREACHABLE() __builtin_unreachable() -#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define HEDLEY_UNREACHABLE() __assume(0) -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) + (NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION))) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() __assume(0) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) #if defined(__cplusplus) - #define HEDLEY_UNREACHABLE() std::_nassert(0) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() std::_nassert(0) #else - #define HEDLEY_UNREACHABLE() _nassert(0) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() _nassert(0) #endif - #define HEDLEY_UNREACHABLE_RETURN(value) return value + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) return value #elif defined(EXIT_FAILURE) - #define HEDLEY_UNREACHABLE() abort() + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() abort() #else - #define HEDLEY_UNREACHABLE() - #define HEDLEY_UNREACHABLE_RETURN(value) return value + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) return value #endif -#if !defined(HEDLEY_UNREACHABLE_RETURN) - #define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE() +#if !defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN) + #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) NLOHMANN_JSON_HEDLEY_UNREACHABLE() #endif -#if defined(HEDLEY_ASSUME) - #undef HEDLEY_ASSUME +#if defined(NLOHMANN_JSON_HEDLEY_ASSUME) + #undef NLOHMANN_JSON_HEDLEY_ASSUME #endif #if \ - HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_ASSUME(expr) __assume(expr) -#elif HEDLEY_HAS_BUILTIN(__builtin_assume) - #define HEDLEY_ASSUME(expr) __builtin_assume(expr) -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) #if defined(__cplusplus) - #define HEDLEY_ASSUME(expr) std::_nassert(expr) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) #else - #define HEDLEY_ASSUME(expr) _nassert(expr) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) _nassert(expr) #endif #elif \ - (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(HEDLEY_ARM_VERSION)) || \ - HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,5) - #define HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) + (NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION)) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) #else - #define HEDLEY_ASSUME(expr) ((void) (expr)) + #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) ((void) (expr)) #endif -HEDLEY_DIAGNOSTIC_PUSH +NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH #if \ - HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ - HEDLEY_GCC_VERSION_CHECK(4,0,0) + NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) #if defined(__clang__) #pragma clang diagnostic ignored "-Wvariadic-macros" - #elif defined(HEDLEY_GCC_VERSION) + #elif defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) #pragma GCC diagnostic ignored "-Wvariadic-macros" #endif #endif -#if defined(HEDLEY_NON_NULL) - #undef HEDLEY_NON_NULL +#if defined(NLOHMANN_JSON_HEDLEY_NON_NULL) + #undef NLOHMANN_JSON_HEDLEY_NON_NULL #endif #if \ - HEDLEY_HAS_ATTRIBUTE(nonnull) || \ - HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) - #define HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define NLOHMANN_JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) #else - #define HEDLEY_NON_NULL(...) + #define NLOHMANN_JSON_HEDLEY_NON_NULL(...) #endif -HEDLEY_DIAGNOSTIC_POP +NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP -#if defined(HEDLEY_PRINTF_FORMAT) - #undef HEDLEY_PRINTF_FORMAT +#if defined(NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT) + #undef NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT #endif -#if defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) -#elif defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#if defined(__MINGW32__) && NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) #elif \ - HEDLEY_HAS_ATTRIBUTE(format) || \ - HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) -#elif HEDLEY_PELLES_VERSION_CHECK(6,0,0) - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) #else - #define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) + #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) #endif -#if defined(HEDLEY_CONSTEXPR) - #undef HEDLEY_CONSTEXPR +#if defined(NLOHMANN_JSON_HEDLEY_CONSTEXPR) + #undef NLOHMANN_JSON_HEDLEY_CONSTEXPR #endif #if defined(__cplusplus) #if __cplusplus >= 201103L - #define HEDLEY_CONSTEXPR constexpr + #define NLOHMANN_JSON_HEDLEY_CONSTEXPR constexpr #endif #endif -#if !defined(HEDLEY_CONSTEXPR) - #define HEDLEY_CONSTEXPR +#if !defined(NLOHMANN_JSON_HEDLEY_CONSTEXPR) + #define NLOHMANN_JSON_HEDLEY_CONSTEXPR #endif -#if defined(HEDLEY_PREDICT) - #undef HEDLEY_PREDICT +#if defined(NLOHMANN_JSON_HEDLEY_PREDICT) + #undef NLOHMANN_JSON_HEDLEY_PREDICT #endif -#if defined(HEDLEY_LIKELY) - #undef HEDLEY_LIKELY +#if defined(NLOHMANN_JSON_HEDLEY_LIKELY) + #undef NLOHMANN_JSON_HEDLEY_LIKELY #endif -#if defined(HEDLEY_UNLIKELY) - #undef HEDLEY_UNLIKELY +#if defined(NLOHMANN_JSON_HEDLEY_UNLIKELY) + #undef NLOHMANN_JSON_HEDLEY_UNLIKELY #endif -#if defined(HEDLEY_UNPREDICTABLE) - #undef HEDLEY_UNPREDICTABLE +#if defined(NLOHMANN_JSON_HEDLEY_UNPREDICTABLE) + #undef NLOHMANN_JSON_HEDLEY_UNPREDICTABLE #endif -#if HEDLEY_HAS_BUILTIN(__builtin_unpredictable) - #define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) +#if NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define NLOHMANN_JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) #endif #if \ - HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ - HEDLEY_GCC_VERSION_CHECK(9,0,0) -# define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) -# define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) -# define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) -# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) -#if !defined(HEDLEY_BUILTIN_UNPREDICTABLE) - #define HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) + NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) +# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) +# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) +# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#if !defined(NLOHMANN_JSON_HEDLEY_BUILTIN_UNPREDICTABLE) + #define NLOHMANN_JSON_HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) #endif #elif \ - HEDLEY_HAS_BUILTIN(__builtin_expect) || \ - HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(6,1,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,27) -# define HEDLEY_PREDICT(expr, expected, probability) \ + NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) +# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, expected, probability) \ (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void) (expected)), !!(expr))) -# define HEDLEY_PREDICT_TRUE(expr, probability) \ +# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ (__extension__ ({ \ - HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + NLOHMANN_JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ })) -# define HEDLEY_PREDICT_FALSE(expr, probability) \ +# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ (__extension__ ({ \ - HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + NLOHMANN_JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ })) -# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) #else -# define HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) -# define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) -# define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) -# define HEDLEY_LIKELY(expr) (!!(expr)) -# define HEDLEY_UNLIKELY(expr) (!!(expr)) +# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) +# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) #endif -#if !defined(HEDLEY_UNPREDICTABLE) - #define HEDLEY_UNPREDICTABLE(expr) HEDLEY_PREDICT(expr, 1, 0.5) +#if !defined(NLOHMANN_JSON_HEDLEY_UNPREDICTABLE) + #define NLOHMANN_JSON_HEDLEY_UNPREDICTABLE(expr) NLOHMANN_JSON_HEDLEY_PREDICT(expr, 1, 0.5) #endif -#if defined(HEDLEY_MALLOC) - #undef HEDLEY_MALLOC +#if defined(NLOHMANN_JSON_HEDLEY_MALLOC) + #undef NLOHMANN_JSON_HEDLEY_MALLOC #endif #if \ - HEDLEY_HAS_ATTRIBUTE(malloc) || \ - HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_MALLOC __attribute__((__malloc__)) -#elif HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) - #define HEDLEY_MALLOC __declspec(restrict) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define NLOHMANN_JSON_HEDLEY_MALLOC __declspec(restrict) #else - #define HEDLEY_MALLOC + #define NLOHMANN_JSON_HEDLEY_MALLOC #endif -#if defined(HEDLEY_PURE) - #undef HEDLEY_PURE +#if defined(NLOHMANN_JSON_HEDLEY_PURE) + #undef NLOHMANN_JSON_HEDLEY_PURE #endif #if \ - HEDLEY_HAS_ATTRIBUTE(pure) || \ - HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_PURE __attribute__((__pure__)) -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define HEDLEY_PURE _Pragma("FUNC_IS_PURE;") + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") #else - #define HEDLEY_PURE + #define NLOHMANN_JSON_HEDLEY_PURE #endif -#if defined(HEDLEY_CONST) - #undef HEDLEY_CONST +#if defined(NLOHMANN_JSON_HEDLEY_CONST) + #undef NLOHMANN_JSON_HEDLEY_CONST #endif #if \ - HEDLEY_HAS_ATTRIBUTE(const) || \ - HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define HEDLEY_CONST __attribute__((__const__)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define NLOHMANN_JSON_HEDLEY_CONST __attribute__((__const__)) #else - #define HEDLEY_CONST HEDLEY_PURE + #define NLOHMANN_JSON_HEDLEY_CONST NLOHMANN_JSON_HEDLEY_PURE #endif -#if defined(HEDLEY_RESTRICT) - #undef HEDLEY_RESTRICT +#if defined(NLOHMANN_JSON_HEDLEY_RESTRICT) + #undef NLOHMANN_JSON_HEDLEY_RESTRICT #endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) - #define HEDLEY_RESTRICT restrict + #define NLOHMANN_JSON_HEDLEY_RESTRICT restrict #elif \ - HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ - HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ defined(__clang__) - #define HEDLEY_RESTRICT __restrict -#elif HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) - #define HEDLEY_RESTRICT _Restrict + #define NLOHMANN_JSON_HEDLEY_RESTRICT __restrict +#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_RESTRICT _Restrict #else - #define HEDLEY_RESTRICT + #define NLOHMANN_JSON_HEDLEY_RESTRICT #endif -#if defined(HEDLEY_INLINE) - #undef HEDLEY_INLINE +#if defined(NLOHMANN_JSON_HEDLEY_INLINE) + #undef NLOHMANN_JSON_HEDLEY_INLINE #endif #if \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ (defined(__cplusplus) && (__cplusplus >= 199711L)) - #define HEDLEY_INLINE inline + #define NLOHMANN_JSON_HEDLEY_INLINE inline #elif \ - defined(HEDLEY_GCC_VERSION) || \ - HEDLEY_ARM_VERSION_CHECK(6,2,0) - #define HEDLEY_INLINE __inline__ + defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define NLOHMANN_JSON_HEDLEY_INLINE __inline__ #elif \ - HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) - #define HEDLEY_INLINE __inline + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_INLINE __inline #else - #define HEDLEY_INLINE + #define NLOHMANN_JSON_HEDLEY_INLINE #endif -#if defined(HEDLEY_ALWAYS_INLINE) - #undef HEDLEY_ALWAYS_INLINE +#if defined(NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE) + #undef NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE #endif #if \ - HEDLEY_HAS_ATTRIBUTE(always_inline) || \ - HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE -#elif HEDLEY_MSVC_VERSION_CHECK(12,0,0) - #define HEDLEY_ALWAYS_INLINE __forceinline -#elif HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) - #define HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) NLOHMANN_JSON_HEDLEY_INLINE +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") #else - #define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE + #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE NLOHMANN_JSON_HEDLEY_INLINE #endif -#if defined(HEDLEY_NEVER_INLINE) - #undef HEDLEY_NEVER_INLINE +#if defined(NLOHMANN_JSON_HEDLEY_NEVER_INLINE) + #undef NLOHMANN_JSON_HEDLEY_NEVER_INLINE #endif #if \ - HEDLEY_HAS_ATTRIBUTE(noinline) || \ - HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_NEVER_INLINE __attribute__((__noinline__)) -#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define HEDLEY_NEVER_INLINE __declspec(noinline) -#elif HEDLEY_PGI_VERSION_CHECK(10,2,0) - #define HEDLEY_NEVER_INLINE _Pragma("noinline") -#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define HEDLEY_NEVER_INLINE _Pragma("inline=never") -#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) - #define HEDLEY_NEVER_INLINE __attribute((noinline)) -#elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) - #define HEDLEY_NEVER_INLINE __declspec(noinline) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __declspec(noinline) #else - #define HEDLEY_NEVER_INLINE + #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE #endif -#if defined(HEDLEY_PRIVATE) - #undef HEDLEY_PRIVATE +#if defined(NLOHMANN_JSON_HEDLEY_PRIVATE) + #undef NLOHMANN_JSON_HEDLEY_PRIVATE #endif -#if defined(HEDLEY_PUBLIC) - #undef HEDLEY_PUBLIC +#if defined(NLOHMANN_JSON_HEDLEY_PUBLIC) + #undef NLOHMANN_JSON_HEDLEY_PUBLIC #endif -#if defined(HEDLEY_IMPORT) - #undef HEDLEY_IMPORT +#if defined(NLOHMANN_JSON_HEDLEY_IMPORT) + #undef NLOHMANN_JSON_HEDLEY_IMPORT #endif #if defined(_WIN32) || defined(__CYGWIN__) - #define HEDLEY_PRIVATE - #define HEDLEY_PUBLIC __declspec(dllexport) - #define HEDLEY_IMPORT __declspec(dllimport) + #define NLOHMANN_JSON_HEDLEY_PRIVATE + #define NLOHMANN_JSON_HEDLEY_PUBLIC __declspec(dllexport) + #define NLOHMANN_JSON_HEDLEY_IMPORT __declspec(dllimport) #else #if \ - HEDLEY_HAS_ATTRIBUTE(visibility) || \ - HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) - #define HEDLEY_PUBLIC __attribute__((__visibility__("default"))) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define NLOHMANN_JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) + #define NLOHMANN_JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) #else - #define HEDLEY_PRIVATE - #define HEDLEY_PUBLIC + #define NLOHMANN_JSON_HEDLEY_PRIVATE + #define NLOHMANN_JSON_HEDLEY_PUBLIC #endif - #define HEDLEY_IMPORT extern + #define NLOHMANN_JSON_HEDLEY_IMPORT extern #endif -#if defined(HEDLEY_NO_THROW) - #undef HEDLEY_NO_THROW +#if defined(NLOHMANN_JSON_HEDLEY_NO_THROW) + #undef NLOHMANN_JSON_HEDLEY_NO_THROW #endif #if \ - HEDLEY_HAS_ATTRIBUTE(nothrow) || \ - HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define HEDLEY_NO_THROW __attribute__((__nothrow__)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define NLOHMANN_JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) #elif \ - HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) - #define HEDLEY_NO_THROW __declspec(nothrow) + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define NLOHMANN_JSON_HEDLEY_NO_THROW __declspec(nothrow) #else - #define HEDLEY_NO_THROW + #define NLOHMANN_JSON_HEDLEY_NO_THROW #endif -#if defined(HEDLEY_FALL_THROUGH) - #undef HEDLEY_FALL_THROUGH +#if defined(NLOHMANN_JSON_HEDLEY_FALL_THROUGH) + #undef NLOHMANN_JSON_HEDLEY_FALL_THROUGH #endif #if \ defined(__cplusplus) && \ - (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ - !defined(HEDLEY_PGI_VERSION) + (!defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) || NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) #if \ (__cplusplus >= 201703L) || \ - ((__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) - #define HEDLEY_FALL_THROUGH [[fallthrough]] - #elif (__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) - #define HEDLEY_FALL_THROUGH [[clang::fallthrough]] - #elif (__cplusplus >= 201103L) && HEDLEY_GCC_VERSION_CHECK(7,0,0) - #define HEDLEY_FALL_THROUGH [[gnu::fallthrough]] + ((__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[fallthrough]] + #elif (__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[clang::fallthrough]] + #elif (__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[gnu::fallthrough]] #endif #endif -#if !defined(HEDLEY_FALL_THROUGH) - #if HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(HEDLEY_PGI_VERSION) - #define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#if !defined(NLOHMANN_JSON_HEDLEY_FALL_THROUGH) + #if NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) #elif defined(__fallthrough) /* SAL */ - #define HEDLEY_FALL_THROUGH __fallthrough + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH __fallthrough #else - #define HEDLEY_FALL_THROUGH + #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH #endif #endif -#if defined(HEDLEY_RETURNS_NON_NULL) - #undef HEDLEY_RETURNS_NON_NULL +#if defined(NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL) + #undef NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL #endif #if \ - HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ - HEDLEY_GCC_VERSION_CHECK(4,9,0) - #define HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) + NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) #elif defined(_Ret_notnull_) /* SAL */ - #define HEDLEY_RETURNS_NON_NULL _Ret_notnull_ + #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ #else - #define HEDLEY_RETURNS_NON_NULL + #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL #endif -#if defined(HEDLEY_ARRAY_PARAM) - #undef HEDLEY_ARRAY_PARAM +#if defined(NLOHMANN_JSON_HEDLEY_ARRAY_PARAM) + #undef NLOHMANN_JSON_HEDLEY_ARRAY_PARAM #endif #if \ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ !defined(__STDC_NO_VLA__) && \ !defined(__cplusplus) && \ - !defined(HEDLEY_PGI_VERSION) && \ - !defined(HEDLEY_TINYC_VERSION) - #define HEDLEY_ARRAY_PARAM(name) (name) + !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) && \ + !defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) + #define NLOHMANN_JSON_HEDLEY_ARRAY_PARAM(name) (name) #else - #define HEDLEY_ARRAY_PARAM(name) + #define NLOHMANN_JSON_HEDLEY_ARRAY_PARAM(name) #endif -#if defined(HEDLEY_IS_CONSTANT) - #undef HEDLEY_IS_CONSTANT +#if defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) + #undef NLOHMANN_JSON_HEDLEY_IS_CONSTANT #endif -#if defined(HEDLEY_REQUIRE_CONSTEXPR) - #undef HEDLEY_REQUIRE_CONSTEXPR +#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR #endif /* Note the double-underscore. For internal use only; no API * guarantees! */ -#if defined(HEDLEY__IS_CONSTEXPR) - #undef HEDLEY__IS_CONSTEXPR +#if defined(NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR) + #undef NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR #endif #if \ - HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ - HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ - HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - HEDLEY_TI_VERSION_CHECK(6,1,0) || \ - HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ - HEDLEY_CRAY_VERSION_CHECK(8,1,0) - #define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) + NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ + NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) #endif #if !defined(__cplusplus) # if \ - HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ - HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,24) + NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) #if defined(__INTPTR_TYPE__) - #define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) + #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) #else #include - #define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) + #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) #endif # elif \ - (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(HEDLEY_SUNPRO_VERSION) && !defined(HEDLEY_PGI_VERSION)) || \ - HEDLEY_HAS_EXTENSION(c_generic_selections) || \ - HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ - HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ - HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ - HEDLEY_ARM_VERSION_CHECK(5,3,0) + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) && !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION)) || \ + NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) #if defined(__INTPTR_TYPE__) - #define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) + #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) #else #include - #define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) + #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) #endif # elif \ - defined(HEDLEY_GCC_VERSION) || \ - defined(HEDLEY_INTEL_VERSION) || \ - defined(HEDLEY_TINYC_VERSION) || \ - defined(HEDLEY_TI_VERSION) || \ + defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) || \ + defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) || \ + defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) || \ + defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) || \ defined(__clang__) -# define HEDLEY__IS_CONSTEXPR(expr) ( \ +# define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) ( \ sizeof(void) != \ sizeof(*( \ 1 ? \ @@ -1380,241 +1380,241 @@ HEDLEY_DIAGNOSTIC_POP ((struct { char v[sizeof(void) * 2]; } *) 1) \ ) \ ) \ - ) + ) # endif #endif -#if defined(HEDLEY__IS_CONSTEXPR) - #if !defined(HEDLEY_IS_CONSTANT) - #define HEDLEY_IS_CONSTANT(expr) HEDLEY__IS_CONSTEXPR(expr) +#if defined(NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR) + #if !defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) + #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) #endif - #define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) + #define NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) #else - #if !defined(HEDLEY_IS_CONSTANT) - #define HEDLEY_IS_CONSTANT(expr) (0) + #if !defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) + #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) (0) #endif - #define HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) + #define NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) #endif -#if defined(HEDLEY_BEGIN_C_DECLS) - #undef HEDLEY_BEGIN_C_DECLS +#if defined(NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS) + #undef NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS #endif -#if defined(HEDLEY_END_C_DECLS) - #undef HEDLEY_END_C_DECLS +#if defined(NLOHMANN_JSON_HEDLEY_END_C_DECLS) + #undef NLOHMANN_JSON_HEDLEY_END_C_DECLS #endif -#if defined(HEDLEY_C_DECL) - #undef HEDLEY_C_DECL +#if defined(NLOHMANN_JSON_HEDLEY_C_DECL) + #undef NLOHMANN_JSON_HEDLEY_C_DECL #endif #if defined(__cplusplus) - #define HEDLEY_BEGIN_C_DECLS extern "C" { - #define HEDLEY_END_C_DECLS } - #define HEDLEY_C_DECL extern "C" + #define NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define NLOHMANN_JSON_HEDLEY_END_C_DECLS } + #define NLOHMANN_JSON_HEDLEY_C_DECL extern "C" #else - #define HEDLEY_BEGIN_C_DECLS - #define HEDLEY_END_C_DECLS - #define HEDLEY_C_DECL + #define NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS + #define NLOHMANN_JSON_HEDLEY_END_C_DECLS + #define NLOHMANN_JSON_HEDLEY_C_DECL #endif -#if defined(HEDLEY_STATIC_ASSERT) - #undef HEDLEY_STATIC_ASSERT +#if defined(NLOHMANN_JSON_HEDLEY_STATIC_ASSERT) + #undef NLOHMANN_JSON_HEDLEY_STATIC_ASSERT #endif #if \ !defined(__cplusplus) && ( \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ - HEDLEY_HAS_FEATURE(c_static_assert) || \ - HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + NLOHMANN_JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ defined(_Static_assert) \ ) -# define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) #elif \ (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ - HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ - (defined(__cplusplus) && HEDLEY_TI_VERSION_CHECK(8,3,0)) -# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) + NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + (defined(__cplusplus) && NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,3,0)) +# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) #elif defined(__cplusplus) && (__cplusplus >= 201103L) -# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) +# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) #else -# define HEDLEY_STATIC_ASSERT(expr, message) +# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) #endif -#if defined(HEDLEY_CONST_CAST) - #undef HEDLEY_CONST_CAST +#if defined(NLOHMANN_JSON_HEDLEY_CONST_CAST) + #undef NLOHMANN_JSON_HEDLEY_CONST_CAST #endif #if defined(__cplusplus) -# define HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) #elif \ - HEDLEY_HAS_WARNING("-Wcast-qual") || \ - HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) -# define HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ - HEDLEY_DIAGNOSTIC_PUSH \ - HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ ((T) (expr)); \ - HEDLEY_DIAGNOSTIC_POP \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP \ })) #else -# define HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) #endif -#if defined(HEDLEY_REINTERPRET_CAST) - #undef HEDLEY_REINTERPRET_CAST +#if defined(NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST) + #undef NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST #endif #if defined(__cplusplus) - #define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) + #define NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) #else - #define HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) + #define NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) #endif -#if defined(HEDLEY_STATIC_CAST) - #undef HEDLEY_STATIC_CAST +#if defined(NLOHMANN_JSON_HEDLEY_STATIC_CAST) + #undef NLOHMANN_JSON_HEDLEY_STATIC_CAST #endif #if defined(__cplusplus) - #define HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) + #define NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) #else - #define HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) + #define NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) #endif -#if defined(HEDLEY_CPP_CAST) - #undef HEDLEY_CPP_CAST +#if defined(NLOHMANN_JSON_HEDLEY_CPP_CAST) + #undef NLOHMANN_JSON_HEDLEY_CPP_CAST #endif #if defined(__cplusplus) - #define HEDLEY_CPP_CAST(T, expr) static_cast(expr) + #define NLOHMANN_JSON_HEDLEY_CPP_CAST(T, expr) static_cast(expr) #else - #define HEDLEY_CPP_CAST(T, expr) (expr) + #define NLOHMANN_JSON_HEDLEY_CPP_CAST(T, expr) (expr) #endif -#if defined(HEDLEY_MESSAGE) - #undef HEDLEY_MESSAGE +#if defined(NLOHMANN_JSON_HEDLEY_MESSAGE) + #undef NLOHMANN_JSON_HEDLEY_MESSAGE #endif -#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") -# define HEDLEY_MESSAGE(msg) \ - HEDLEY_DIAGNOSTIC_PUSH \ - HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - HEDLEY_PRAGMA(message msg) \ - HEDLEY_DIAGNOSTIC_POP +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + NLOHMANN_JSON_HEDLEY_PRAGMA(message msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP #elif \ - HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ - HEDLEY_INTEL_VERSION_CHECK(13,0,0) -# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message msg) -#elif HEDLEY_CRAY_VERSION_CHECK(5,0,0) -# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(_CRI message msg) -#elif HEDLEY_IAR_VERSION_CHECK(8,0,0) -# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) -#elif HEDLEY_PELLES_VERSION_CHECK(2,0,0) -# define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message msg) +#elif NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) +#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) #else -# define HEDLEY_MESSAGE(msg) +# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) #endif -#if defined(HEDLEY_WARNING) - #undef HEDLEY_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_WARNING) + #undef NLOHMANN_JSON_HEDLEY_WARNING #endif -#if HEDLEY_HAS_WARNING("-Wunknown-pragmas") -# define HEDLEY_WARNING(msg) \ - HEDLEY_DIAGNOSTIC_PUSH \ - HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - HEDLEY_PRAGMA(clang warning msg) \ - HEDLEY_DIAGNOSTIC_POP +#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define NLOHMANN_JSON_HEDLEY_WARNING(msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + NLOHMANN_JSON_HEDLEY_PRAGMA(clang warning msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP #elif \ - HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ - HEDLEY_PGI_VERSION_CHECK(18,4,0) -# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg) -#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) -# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg)) + NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) +# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) #else -# define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg) +# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_MESSAGE(msg) #endif -#if defined(HEDLEY_REQUIRE_MSG) - #undef HEDLEY_REQUIRE_MSG +#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE_MSG) + #undef NLOHMANN_JSON_HEDLEY_REQUIRE_MSG #endif -#if HEDLEY_HAS_ATTRIBUTE(diagnose_if) -# if HEDLEY_HAS_WARNING("-Wgcc-compat") -# define HEDLEY_REQUIRE_MSG(expr, msg) \ - HEDLEY_DIAGNOSTIC_PUSH \ +#if NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ __attribute__((__diagnose_if__(!(expr), msg, "error"))) \ - HEDLEY_DIAGNOSTIC_POP + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP # else -# define HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) +# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) # endif #else -# define HEDLEY_REQUIRE_MSG(expr, msg) +# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) #endif -#if defined(HEDLEY_REQUIRE) - #undef HEDLEY_REQUIRE +#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE) + #undef NLOHMANN_JSON_HEDLEY_REQUIRE #endif -#define HEDLEY_REQUIRE(expr) HEDLEY_REQUIRE_MSG(expr, #expr) +#define NLOHMANN_JSON_HEDLEY_REQUIRE(expr) NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, #expr) -#if defined(HEDLEY_FLAGS) - #undef HEDLEY_FLAGS +#if defined(NLOHMANN_JSON_HEDLEY_FLAGS) + #undef NLOHMANN_JSON_HEDLEY_FLAGS #endif -#if HEDLEY_HAS_ATTRIBUTE(flag_enum) - #define HEDLEY_FLAGS __attribute__((__flag_enum__)) +#if NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define NLOHMANN_JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) #endif -#if defined(HEDLEY_FLAGS_CAST) - #undef HEDLEY_FLAGS_CAST +#if defined(NLOHMANN_JSON_HEDLEY_FLAGS_CAST) + #undef NLOHMANN_JSON_HEDLEY_FLAGS_CAST #endif -#if HEDLEY_INTEL_VERSION_CHECK(19,0,0) -# define HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ - HEDLEY_DIAGNOSTIC_PUSH \ +#if NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define NLOHMANN_JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("warning(disable:188)") \ ((T) (expr)); \ - HEDLEY_DIAGNOSTIC_POP \ + NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP \ })) #else -# define HEDLEY_FLAGS_CAST(T, expr) HEDLEY_STATIC_CAST(T, expr) +# define NLOHMANN_JSON_HEDLEY_FLAGS_CAST(T, expr) NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) #endif /* Remaining macros are deprecated. */ -#if defined(HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) - #undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#if defined(NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK #endif #if defined(__clang__) - #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) + #define NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) #else - #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(HEDLEY_CLANG_HAS_ATTRIBUTE) - #undef HEDLEY_CLANG_HAS_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE #endif -#define HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) HEDLEY_HAS_ATTRIBUTE(attribute) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) -#if defined(HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) - #undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE #endif -#define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) HEDLEY_HAS_CPP_ATTRIBUTE(attribute) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) -#if defined(HEDLEY_CLANG_HAS_BUILTIN) - #undef HEDLEY_CLANG_HAS_BUILTIN +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN #endif -#define HEDLEY_CLANG_HAS_BUILTIN(builtin) HEDLEY_HAS_BUILTIN(builtin) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) -#if defined(HEDLEY_CLANG_HAS_FEATURE) - #undef HEDLEY_CLANG_HAS_FEATURE +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE #endif -#define HEDLEY_CLANG_HAS_FEATURE(feature) HEDLEY_HAS_FEATURE(feature) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE(feature) NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) -#if defined(HEDLEY_CLANG_HAS_EXTENSION) - #undef HEDLEY_CLANG_HAS_EXTENSION +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION #endif -#define HEDLEY_CLANG_HAS_EXTENSION(extension) HEDLEY_HAS_EXTENSION(extension) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) -#if defined(HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) - #undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE #endif -#define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) -#if defined(HEDLEY_CLANG_HAS_WARNING) - #undef HEDLEY_CLANG_HAS_WARNING +#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING) + #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING #endif -#define HEDLEY_CLANG_HAS_WARNING(warning) HEDLEY_HAS_WARNING(warning) +#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING(warning) NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) -#endif /* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */ +#endif /* !defined(NLOHMANN_JSON_HEDLEY_VERSION) || (NLOHMANN_JSON_HEDLEY_VERSION < X) */ // This file contains all internal macro definitions @@ -1775,7 +1775,7 @@ class exception : public std::exception { public: /// returns the explanatory string - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL const char* what() const noexcept override { return m.what(); @@ -1785,7 +1785,7 @@ class exception : public std::exception const int id; protected: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} static std::string name(const std::string& ename, int id_) @@ -1938,7 +1938,7 @@ class invalid_iterator : public exception } private: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) invalid_iterator(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -1992,7 +1992,7 @@ class type_error : public exception } private: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -2039,7 +2039,7 @@ class out_of_range : public exception } private: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -2077,7 +2077,7 @@ class other_error : public exception } private: - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; } // namespace detail @@ -2794,7 +2794,7 @@ namespace detail template void from_json(const BasicJsonType& j, typename std::nullptr_t& n) { - if (HEDLEY_UNLIKELY(not j.is_null())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_null())) { JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); } @@ -2834,7 +2834,7 @@ void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) template void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) { - if (HEDLEY_UNLIKELY(not j.is_boolean())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_boolean())) { JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); } @@ -2844,7 +2844,7 @@ void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) template void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) { - if (HEDLEY_UNLIKELY(not j.is_string())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -2860,7 +2860,7 @@ template < int > = 0 > void from_json(const BasicJsonType& j, ConstructibleStringType& s) { - if (HEDLEY_UNLIKELY(not j.is_string())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -2900,7 +2900,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::forward_list& l) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -2917,7 +2917,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::valarray& l) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -3004,7 +3004,7 @@ auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) j.template get(), void()) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); @@ -3017,7 +3017,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) { - if (HEDLEY_UNLIKELY(not j.is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); } @@ -3100,14 +3100,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::map& m) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (HEDLEY_UNLIKELY(not p.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -3120,14 +3120,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::unordered_map& m) { - if (HEDLEY_UNLIKELY(not j.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (HEDLEY_UNLIKELY(not p.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -3806,7 +3806,7 @@ Input adapter for stdio file access. This adapter read only 1 byte and do not us class file_input_adapter : public input_adapter_protocol { public: - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) explicit file_input_adapter(std::FILE* f) noexcept : m_file(f) {} @@ -3882,7 +3882,7 @@ class input_stream_adapter : public input_adapter_protocol class input_buffer_adapter : public input_adapter_protocol { public: - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) input_buffer_adapter(const char* b, const std::size_t l) noexcept : cursor(b), limit(b + l) {} @@ -3896,7 +3896,7 @@ class input_buffer_adapter : public input_adapter_protocol std::char_traits::int_type get_character() noexcept override { - if (HEDLEY_LIKELY(cursor < limit)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(cursor < limit)) { return std::char_traits::to_int_type(*(cursor++)); } @@ -4086,7 +4086,7 @@ class input_adapter { public: // native support - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) input_adapter(std::FILE* file) : ia(std::make_shared(file)) {} /// input adapter for input stream @@ -4155,7 +4155,7 @@ class input_adapter "each element in the iterator range must have the size of 1 byte"); const auto len = static_cast(std::distance(first, last)); - if (HEDLEY_LIKELY(len > 0)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(len > 0)) { // there is at least one element: use the address of first ia = std::make_shared(reinterpret_cast(&(*first)), len); @@ -4403,7 +4403,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); - if (HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); @@ -4429,7 +4429,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); - if (HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); @@ -4485,7 +4485,7 @@ class json_sax_dom_parser object to which we can add elements */ template - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL BasicJsonType* handle_value(Value&& v) { if (ref_stack.empty()) @@ -4592,7 +4592,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check object limit - if (ref_stack.back() and HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); } @@ -4655,7 +4655,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check array limit - if (ref_stack.back() and HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); } @@ -5094,7 +5094,7 @@ class binary_reader @return */ - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) bool sax_parse(const input_format_t format, json_sax_t* sax_, const bool strict = true) @@ -5136,7 +5136,7 @@ class binary_reader get(); } - if (HEDLEY_UNLIKELY(current != std::char_traits::eof())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current != std::char_traits::eof())) { return sax->parse_error(chars_read, get_token_string(), parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); @@ -5172,12 +5172,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } - if (HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) { return false; } @@ -5198,7 +5198,7 @@ class binary_reader while (true) { get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) { return false; } @@ -5226,7 +5226,7 @@ class binary_reader template bool get_bson_string(const NumberType len, string_t& result) { - if (HEDLEY_UNLIKELY(len < 1)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len < 1)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); @@ -5321,13 +5321,13 @@ class binary_reader string_t key; while (int element_type = get()) { - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) { return false; } const std::size_t element_type_parse_position = chars_read; - if (HEDLEY_UNLIKELY(not get_bson_cstr(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_bson_cstr(key))) { return false; } @@ -5337,7 +5337,7 @@ class binary_reader return false; } - if (HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) { return false; } @@ -5358,12 +5358,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } - if (HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) { return false; } @@ -5648,12 +5648,12 @@ class binary_reader case 0xF9: // Half-Precision Float (two-byte IEEE 754) { const int byte1_raw = get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } const int byte2_raw = get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } @@ -5726,7 +5726,7 @@ class binary_reader */ bool get_cbor_string(string_t& result) { - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) { return false; } @@ -5815,7 +5815,7 @@ class binary_reader */ bool get_cbor_array(const std::size_t len) { - if (HEDLEY_UNLIKELY(not sax->start_array(len))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } @@ -5824,7 +5824,7 @@ class binary_reader { for (std::size_t i = 0; i < len; ++i) { - if (HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -5834,7 +5834,7 @@ class binary_reader { while (get() != 0xFF) { - if (HEDLEY_UNLIKELY(not parse_cbor_internal(false))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal(false))) { return false; } @@ -5851,7 +5851,7 @@ class binary_reader */ bool get_cbor_object(const std::size_t len) { - if (HEDLEY_UNLIKELY(not sax->start_object(len))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -5862,12 +5862,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -5878,12 +5878,12 @@ class binary_reader { while (get() != 0xFF) { - if (HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -6272,7 +6272,7 @@ class binary_reader */ bool get_msgpack_string(string_t& result) { - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) { return false; } @@ -6348,14 +6348,14 @@ class binary_reader */ bool get_msgpack_array(const std::size_t len) { - if (HEDLEY_UNLIKELY(not sax->start_array(len))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } for (std::size_t i = 0; i < len; ++i) { - if (HEDLEY_UNLIKELY(not parse_msgpack_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -6370,7 +6370,7 @@ class binary_reader */ bool get_msgpack_object(const std::size_t len) { - if (HEDLEY_UNLIKELY(not sax->start_object(len))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -6379,12 +6379,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_msgpack_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -6431,7 +6431,7 @@ class binary_reader get(); // TODO(niels): may we ignore N here? } - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -6485,7 +6485,7 @@ class binary_reader case 'U': { std::uint8_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6496,7 +6496,7 @@ class binary_reader case 'i': { std::int8_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6507,7 +6507,7 @@ class binary_reader case 'I': { std::int16_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6518,7 +6518,7 @@ class binary_reader case 'l': { std::int32_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6529,7 +6529,7 @@ class binary_reader case 'L': { std::int64_t number; - if (HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6565,15 +6565,15 @@ class binary_reader if (current == '$') { result.second = get(); // must not ignore 'N', because 'N' maybe the type - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) { return false; } get_ignore_noop(); - if (HEDLEY_UNLIKELY(current != '#')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current != '#')) { - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -6656,11 +6656,11 @@ class binary_reader case 'C': // char { get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) { return false; } - if (HEDLEY_UNLIKELY(current > 127)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current > 127)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); @@ -6695,14 +6695,14 @@ class binary_reader bool get_ubjson_array() { std::pair size_and_type; - if (HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } if (size_and_type.first != string_t::npos) { - if (HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) { return false; } @@ -6713,7 +6713,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -6724,7 +6724,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -6733,14 +6733,14 @@ class binary_reader } else { - if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } while (current != ']') { - if (HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) { return false; } @@ -6757,7 +6757,7 @@ class binary_reader bool get_ubjson_object() { std::pair size_and_type; - if (HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } @@ -6765,7 +6765,7 @@ class binary_reader string_t key; if (size_and_type.first != string_t::npos) { - if (HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) { return false; } @@ -6774,11 +6774,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -6789,11 +6789,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -6803,18 +6803,18 @@ class binary_reader } else { - if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } while (current != '}') { - if (HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) { return false; } - if (HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -6880,7 +6880,7 @@ class binary_reader for (std::size_t i = 0; i < sizeof(NumberType); ++i) { get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) { return false; } @@ -6924,7 +6924,7 @@ class binary_reader std::generate_n(std::back_inserter(result), len, [this, &success, &format]() { get(); - if (HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) { success = false; } @@ -6938,10 +6938,10 @@ class binary_reader @param[in] context further context information (for diagnostics) @return whether the last read character is not EOF */ - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) bool unexpect_eof(const input_format_t format, const char* context) const { - if (HEDLEY_UNLIKELY(current == std::char_traits::eof())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current == std::char_traits::eof())) { return sax->parse_error(chars_read, "", parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); @@ -7082,7 +7082,7 @@ class lexer }; /// return name of values of type token_type (only used for errors) - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL static const char* token_type_name(const token_type t) noexcept { switch (t) @@ -7224,7 +7224,7 @@ class lexer for (auto range = ranges.begin(); range != ranges.end(); ++range) { get(); - if (HEDLEY_LIKELY(*range <= current and current <= *(++range))) + if (NLOHMANN_JSON_HEDLEY_LIKELY(*range <= current and current <= *(++range))) { add(current); } @@ -7323,7 +7323,7 @@ class lexer const int codepoint1 = get_codepoint(); int codepoint = codepoint1; // start with codepoint1 - if (HEDLEY_UNLIKELY(codepoint1 == -1)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; @@ -7333,18 +7333,18 @@ class lexer if (0xD800 <= codepoint1 and codepoint1 <= 0xDBFF) { // expect next \uxxxx entry - if (HEDLEY_LIKELY(get() == '\\' and get() == 'u')) + if (NLOHMANN_JSON_HEDLEY_LIKELY(get() == '\\' and get() == 'u')) { const int codepoint2 = get_codepoint(); - if (HEDLEY_UNLIKELY(codepoint2 == -1)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; } // check if codepoint2 is a low surrogate - if (HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) { // overwrite codepoint codepoint = static_cast( @@ -7371,7 +7371,7 @@ class lexer } else { - if (HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) { error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; return token_type::parse_error; @@ -7746,7 +7746,7 @@ class lexer case 0xDE: case 0xDF: { - if (HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) { return token_type::parse_error; } @@ -7756,7 +7756,7 @@ class lexer // U+0800..U+0FFF: bytes E0 A0..BF 80..BF case 0xE0: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7780,7 +7780,7 @@ class lexer case 0xEE: case 0xEF: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7790,7 +7790,7 @@ class lexer // U+D000..U+D7FF: bytes ED 80..9F 80..BF case 0xED: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7800,7 +7800,7 @@ class lexer // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF case 0xF0: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7812,7 +7812,7 @@ class lexer case 0xF2: case 0xF3: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7822,7 +7822,7 @@ class lexer // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF case 0xF4: { - if (HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7839,19 +7839,19 @@ class lexer } } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); @@ -8227,14 +8227,14 @@ scan_number_done: @param[in] length the length of the passed literal text @param[in] return_type the token type to return on success */ - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) token_type scan_literal(const char* literal_text, const std::size_t length, token_type return_type) { assert(current == literal_text[0]); for (std::size_t i = 1; i < length; ++i) { - if (HEDLEY_UNLIKELY(get() != literal_text[i])) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get() != literal_text[i])) { error_message = "invalid literal"; return token_type::parse_error; @@ -8280,7 +8280,7 @@ scan_number_done: current = ia->get_character(); } - if (HEDLEY_LIKELY(current != std::char_traits::eof())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) { token_string.push_back(std::char_traits::to_char_type(current)); } @@ -8321,7 +8321,7 @@ scan_number_done: --position.chars_read_current_line; } - if (HEDLEY_LIKELY(current != std::char_traits::eof())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) { assert(not token_string.empty()); token_string.pop_back(); @@ -8400,7 +8400,7 @@ scan_number_done: } /// return syntax error message - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL constexpr const char* get_error_message() const noexcept { return error_message; @@ -8689,7 +8689,7 @@ class parser } template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) bool sax_parse(SAX* sax, const bool strict = true) { (void)detail::is_sax_static_asserts {}; @@ -8709,7 +8709,7 @@ class parser private: template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) bool sax_parse_internal(SAX* sax) { // stack to remember the hierarchy of structured values we are parsing @@ -8727,7 +8727,7 @@ class parser { case token_type::begin_object: { - if (HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } @@ -8735,7 +8735,7 @@ class parser // closing } -> we are done if (get_token() == token_type::end_object) { - if (HEDLEY_UNLIKELY(not sax->end_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -8743,20 +8743,20 @@ class parser } // parse key - if (HEDLEY_UNLIKELY(last_token != token_type::value_string)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"))); } - if (HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -8774,7 +8774,7 @@ class parser case token_type::begin_array: { - if (HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } @@ -8782,7 +8782,7 @@ class parser // closing ] -> we are done if (get_token() == token_type::end_array) { - if (HEDLEY_UNLIKELY(not sax->end_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -8800,14 +8800,14 @@ class parser { const auto res = m_lexer.get_number_float(); - if (HEDLEY_UNLIKELY(not std::isfinite(res))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not std::isfinite(res))) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); } - if (HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) { return false; } @@ -8817,7 +8817,7 @@ class parser case token_type::literal_false: { - if (HEDLEY_UNLIKELY(not sax->boolean(false))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->boolean(false))) { return false; } @@ -8826,7 +8826,7 @@ class parser case token_type::literal_null: { - if (HEDLEY_UNLIKELY(not sax->null())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->null())) { return false; } @@ -8835,7 +8835,7 @@ class parser case token_type::literal_true: { - if (HEDLEY_UNLIKELY(not sax->boolean(true))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->boolean(true))) { return false; } @@ -8844,7 +8844,7 @@ class parser case token_type::value_integer: { - if (HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) { return false; } @@ -8853,7 +8853,7 @@ class parser case token_type::value_string: { - if (HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) { return false; } @@ -8862,7 +8862,7 @@ class parser case token_type::value_unsigned: { - if (HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) { return false; } @@ -8910,9 +8910,9 @@ class parser } // closing ] - if (HEDLEY_LIKELY(last_token == token_type::end_array)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) { - if (HEDLEY_UNLIKELY(not sax->end_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -8938,7 +8938,7 @@ class parser if (get_token() == token_type::value_separator) { // parse key - if (HEDLEY_UNLIKELY(get_token() != token_type::value_string)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -8946,13 +8946,13 @@ class parser exception_message(token_type::value_string, "object key"))); } - if (HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -8966,9 +8966,9 @@ class parser } // closing } - if (HEDLEY_LIKELY(last_token == token_type::end_object)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) { - if (HEDLEY_UNLIKELY(not sax->end_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -9452,7 +9452,7 @@ class iter_impl default: { - if (HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return *m_object; } @@ -9486,7 +9486,7 @@ class iter_impl default: { - if (HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return m_object; } @@ -9589,7 +9589,7 @@ class iter_impl bool operator==(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (HEDLEY_UNLIKELY(m_object != other.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -9625,7 +9625,7 @@ class iter_impl bool operator<(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (HEDLEY_UNLIKELY(m_object != other.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -9785,7 +9785,7 @@ class iter_impl default: { - if (HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) { return *m_object; } @@ -9803,7 +9803,7 @@ class iter_impl { assert(m_object != nullptr); - if (HEDLEY_LIKELY(m_object->is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(m_object->is_object())) { return m_it.object_iterator->first; } @@ -10204,7 +10204,7 @@ class json_pointer */ void pop_back() { - if (HEDLEY_UNLIKELY(empty())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -10228,7 +10228,7 @@ class json_pointer */ const std::string& back() { - if (HEDLEY_UNLIKELY(empty())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -10292,7 +10292,7 @@ class json_pointer const int res = std::stoi(s, &processed_chars); // check if the string was completely read - if (HEDLEY_UNLIKELY(processed_chars != s.size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) { JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); } @@ -10302,7 +10302,7 @@ class json_pointer json_pointer top() const { - if (HEDLEY_UNLIKELY(empty())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -10434,7 +10434,7 @@ class json_pointer case detail::value_t::array: { // error condition (cf. RFC 6901, Sect. 4) - if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -10492,7 +10492,7 @@ class json_pointer case detail::value_t::array: { - if (HEDLEY_UNLIKELY(reference_token == "-")) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -10501,7 +10501,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -10557,7 +10557,7 @@ class json_pointer case detail::value_t::array: { - if (HEDLEY_UNLIKELY(reference_token == "-")) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" cannot be used for const access JSON_THROW(detail::out_of_range::create(402, @@ -10566,7 +10566,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -10616,7 +10616,7 @@ class json_pointer case detail::value_t::array: { - if (HEDLEY_UNLIKELY(reference_token == "-")) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -10625,7 +10625,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -10672,7 +10672,7 @@ class json_pointer } // check if nonempty reference string begins with slash - if (HEDLEY_UNLIKELY(reference_string[0] != '/')) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) { JSON_THROW(detail::parse_error::create(107, 1, "JSON pointer must be empty or begin with '/' - was: '" + @@ -10707,9 +10707,9 @@ class json_pointer assert(reference_token[pos] == '~'); // ~ must be followed by 0 or 1 - if (HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or - (reference_token[pos + 1] != '0' and - reference_token[pos + 1] != '1'))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or + (reference_token[pos + 1] != '0' and + reference_token[pos + 1] != '1'))) { JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); } @@ -10834,7 +10834,7 @@ class json_pointer static BasicJsonType unflatten(const BasicJsonType& value) { - if (HEDLEY_UNLIKELY(not value.is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not value.is_object())) { JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); } @@ -10844,7 +10844,7 @@ class json_pointer // iterate the JSON object values for (const auto& element : *value.m_value.object) { - if (HEDLEY_UNLIKELY(not element.second.is_primitive())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not element.second.is_primitive())) { JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); } @@ -11034,7 +11034,7 @@ class output_vector_adapter : public output_adapter_protocol v.push_back(c); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { std::copy(s, s + length, std::back_inserter(v)); @@ -11058,7 +11058,7 @@ class output_stream_adapter : public output_adapter_protocol stream.put(c); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { stream.write(s, static_cast(length)); @@ -11082,7 +11082,7 @@ class output_string_adapter : public output_adapter_protocol str.push_back(c); } - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { str.append(s, length); @@ -11821,7 +11821,7 @@ class binary_writer static std::size_t calc_bson_entry_header_size(const string_t& name) { const auto it = name.find(static_cast(0)); - if (HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) { JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); @@ -13283,7 +13283,7 @@ v = buf * 10^decimal_exponent len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ -HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_NON_NULL(1) inline void grisu2(char* buf, int& len, int& decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) { @@ -13343,7 +13343,7 @@ len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ template -HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_NON_NULL(1) void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) { static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, @@ -13382,8 +13382,8 @@ void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) @return a pointer to the element following the exponent. @pre -1000 < e < 1000 */ -HEDLEY_NON_NULL(1) -HEDLEY_RETURNS_NON_NULL +NLOHMANN_JSON_HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL inline char* append_exponent(char* buf, int e) { assert(e > -1000); @@ -13434,8 +13434,8 @@ notation. Otherwise it will be printed in exponential notation. @pre min_exp < 0 @pre max_exp > 0 */ -HEDLEY_NON_NULL(1) -HEDLEY_RETURNS_NON_NULL +NLOHMANN_JSON_HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL inline char* format_buffer(char* buf, int len, int decimal_exponent, int min_exp, int max_exp) { @@ -13519,8 +13519,8 @@ format. Returns an iterator pointing past-the-end of the decimal representation. @note The result is NOT null-terminated. */ template -HEDLEY_NON_NULL(1, 2) -HEDLEY_RETURNS_NON_NULL +NLOHMANN_JSON_HEDLEY_NON_NULL(1, 2) +NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL char* to_chars(char* first, const char* last, FloatType value) { static_cast(last); // maybe unused - fix warning @@ -13670,7 +13670,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -13743,7 +13743,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -14058,7 +14058,7 @@ class serializer } // we finished processing the string - if (HEDLEY_LIKELY(state == UTF8_ACCEPT)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) { // write buffer if (bytes > 0) @@ -14651,7 +14651,7 @@ class basic_json @since 2.1.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json meta() { basic_json result; @@ -15156,7 +15156,7 @@ class basic_json /// helper for exception-safe object creation template - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL static T* create(Args&& ... args) { AllocatorType alloc; @@ -15283,7 +15283,7 @@ class basic_json default: { object = nullptr; // silence warning, see #821 - if (HEDLEY_UNLIKELY(t == value_t::null)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(t == value_t::null)) { JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.6.1")); // LCOV_EXCL_LINE } @@ -15760,7 +15760,7 @@ class basic_json } // if object is wanted but impossible, throw an exception - if (HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) { JSON_THROW(type_error::create(301, "cannot create object from initializer list")); } @@ -15827,7 +15827,7 @@ class basic_json @since version 1.0.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json array(initializer_list_t init = {}) { return basic_json(init, false, value_t::array); @@ -15871,7 +15871,7 @@ class basic_json @since version 1.0.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json object(initializer_list_t init = {}) { return basic_json(init, false, value_t::object); @@ -15970,7 +15970,7 @@ class basic_json assert(last.m_object != nullptr); // make sure iterator fits the current value - if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); } @@ -15987,8 +15987,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -16701,7 +16701,7 @@ class basic_json /// get a boolean (explicit) boolean_t get_impl(boolean_t* /*unused*/) const { - if (HEDLEY_LIKELY(is_boolean())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_boolean())) { return m_value.boolean; } @@ -16810,7 +16810,7 @@ class basic_json // delegate the call to get_ptr<>() auto ptr = obj.template get_ptr::type>(); - if (HEDLEY_LIKELY(ptr != nullptr)) + if (NLOHMANN_JSON_HEDLEY_LIKELY(ptr != nullptr)) { return *ptr; } @@ -17261,7 +17261,7 @@ class basic_json reference at(size_type idx) { // at only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -17308,7 +17308,7 @@ class basic_json const_reference at(size_type idx) const { // at only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -17359,7 +17359,7 @@ class basic_json reference at(const typename object_t::key_type& key) { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -17410,7 +17410,7 @@ class basic_json const_reference at(const typename object_t::key_type& key) const { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -17464,7 +17464,7 @@ class basic_json } // operator[] only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { // fill up array with null values if given idx is outside range if (idx >= m_value.array->size()) @@ -17502,7 +17502,7 @@ class basic_json const_reference operator[](size_type idx) const { // const operator[] only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { return m_value.array->operator[](idx); } @@ -17548,7 +17548,7 @@ class basic_json } // operator[] only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -17589,7 +17589,7 @@ class basic_json const_reference operator[](const typename object_t::key_type& key) const { // const operator[] only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -17626,7 +17626,7 @@ class basic_json @since version 1.1.0 */ template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) reference operator[](T* key) { // implicitly convert null to object @@ -17638,7 +17638,7 @@ class basic_json } // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -17677,11 +17677,11 @@ class basic_json @since version 1.1.0 */ template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) const_reference operator[](T* key) const { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -17745,7 +17745,7 @@ class basic_json ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { // if key is found, return value and given default value otherwise const auto it = find(key); @@ -17817,7 +17817,7 @@ class basic_json ValueType value(const json_pointer& ptr, const ValueType& default_value) const { // at only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { // if pointer resolves a value, return it or use default value JSON_TRY @@ -17837,7 +17837,7 @@ class basic_json @brief overload for a default value of type const char* @copydoc basic_json::value(const json_pointer&, ValueType) const */ - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) string_t value(const json_pointer& ptr, const char* default_value) const { return value(ptr, string_t(default_value)); @@ -17982,7 +17982,7 @@ class basic_json IteratorType erase(IteratorType pos) { // make sure iterator fits the current value - if (HEDLEY_UNLIKELY(this != pos.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(this != pos.m_object)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -17997,7 +17997,7 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) { JSON_THROW(invalid_iterator::create(205, "iterator out of range")); } @@ -18087,7 +18087,7 @@ class basic_json IteratorType erase(IteratorType first, IteratorType last) { // make sure iterator fits the current value - if (HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) { JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); } @@ -18102,8 +18102,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -18174,7 +18174,7 @@ class basic_json size_type erase(const typename object_t::key_type& key) { // this erase only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->erase(key); } @@ -18209,9 +18209,9 @@ class basic_json void erase(const size_type idx) { // this erase only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { - if (HEDLEY_UNLIKELY(idx >= size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(idx >= size())) { JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); } @@ -18687,7 +18687,7 @@ class basic_json future 4.0.0 of the library. Please use @ref items() instead; that is, replace `json::iterator_wrapper(j)` with `j.items()`. */ - HEDLEY_DEPRECATED(3.1.0) + NLOHMANN_JSON_HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(reference ref) noexcept { return ref.items(); @@ -18696,7 +18696,7 @@ class basic_json /*! @copydoc iterator_wrapper(reference) */ - HEDLEY_DEPRECATED(3.1.0) + NLOHMANN_JSON_HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(const_reference ref) noexcept { return ref.items(); @@ -19115,7 +19115,7 @@ class basic_json void push_back(basic_json&& val) { // push_back only works for null objects or arrays - if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -19152,7 +19152,7 @@ class basic_json void push_back(const basic_json& val) { // push_back only works for null objects or arrays - if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -19202,7 +19202,7 @@ class basic_json void push_back(const typename object_t::value_type& val) { // push_back only works for null objects or objects - if (HEDLEY_UNLIKELY(not(is_null() or is_object()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -19303,7 +19303,7 @@ class basic_json void emplace_back(Args&& ... args) { // emplace_back only works for null objects or arrays - if (HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); } @@ -19351,7 +19351,7 @@ class basic_json std::pair emplace(Args&& ... args) { // emplace only works for null objects or arrays - if (HEDLEY_UNLIKELY(not(is_null() or is_object()))) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); } @@ -19419,10 +19419,10 @@ class basic_json iterator insert(const_iterator pos, const basic_json& val) { // insert only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (HEDLEY_UNLIKELY(pos.m_object != this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -19470,10 +19470,10 @@ class basic_json iterator insert(const_iterator pos, size_type cnt, const basic_json& val) { // insert only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (HEDLEY_UNLIKELY(pos.m_object != this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -19518,24 +19518,24 @@ class basic_json iterator insert(const_iterator pos, const_iterator first, const_iterator last) { // insert only works for arrays - if (HEDLEY_UNLIKELY(not is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (HEDLEY_UNLIKELY(pos.m_object != this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } // check if range iterators belong to the same JSON object - if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } - if (HEDLEY_UNLIKELY(first.m_object == this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object == this)) { JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); } @@ -19571,13 +19571,13 @@ class basic_json iterator insert(const_iterator pos, initializer_list_t ilist) { // insert only works for arrays - if (HEDLEY_UNLIKELY(not is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (HEDLEY_UNLIKELY(pos.m_object != this)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -19612,19 +19612,19 @@ class basic_json void insert(const_iterator first, const_iterator last) { // insert only works for objects - if (HEDLEY_UNLIKELY(not is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (HEDLEY_UNLIKELY(not first.m_object->is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -19661,11 +19661,11 @@ class basic_json assert_invariant(); } - if (HEDLEY_UNLIKELY(not is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } - if (HEDLEY_UNLIKELY(not j.is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); } @@ -19712,20 +19712,20 @@ class basic_json assert_invariant(); } - if (HEDLEY_UNLIKELY(not is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (HEDLEY_UNLIKELY(not first.m_object->is_object() - or not last.m_object->is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_object->is_object() + or not last.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -19788,7 +19788,7 @@ class basic_json void swap(array_t& other) { // swap only works for arrays - if (HEDLEY_LIKELY(is_array())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) { std::swap(*(m_value.array), other); } @@ -19821,7 +19821,7 @@ class basic_json void swap(object_t& other) { // swap only works for objects - if (HEDLEY_LIKELY(is_object())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) { std::swap(*(m_value.object), other); } @@ -19854,7 +19854,7 @@ class basic_json void swap(string_t& other) { // swap only works for strings - if (HEDLEY_LIKELY(is_string())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(is_string())) { std::swap(*(m_value.string), other); } @@ -20364,7 +20364,7 @@ class basic_json instead; that is, replace calls like `j >> o;` with `o << j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - HEDLEY_DEPRECATED(3.0.0) + NLOHMANN_JSON_HEDLEY_DEPRECATED(3.0.0) friend std::ostream& operator>>(const basic_json& j, std::ostream& o) { return o << j; @@ -20443,7 +20443,7 @@ class basic_json @since version 2.0.3 (contiguous containers) */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json parse(detail::input_adapter&& i, const parser_callback_t cb = nullptr, const bool allow_exceptions = true) @@ -20512,7 +20512,7 @@ class basic_json @since version 3.2.0 */ template - HEDLEY_NON_NULL(2) + NLOHMANN_JSON_HEDLEY_NON_NULL(2) static bool sax_parse(detail::input_adapter&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true) @@ -20598,7 +20598,7 @@ class basic_json std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits::iterator_category>::value, int>::type = 0> - HEDLEY_NON_NULL(3) + NLOHMANN_JSON_HEDLEY_NON_NULL(3) static bool sax_parse(IteratorType first, IteratorType last, SAX* sax) { return parser(detail::input_adapter(first, last)).sax_parse(sax); @@ -20612,7 +20612,7 @@ class basic_json instead; that is, replace calls like `j << i;` with `i >> j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - HEDLEY_DEPRECATED(3.0.0) + NLOHMANN_JSON_HEDLEY_DEPRECATED(3.0.0) friend std::istream& operator<<(basic_json& j, std::istream& i) { return operator>>(i, j); @@ -20685,7 +20685,7 @@ class basic_json @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` since 3.0.0 */ - HEDLEY_RETURNS_NON_NULL + NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL const char* type_name() const noexcept { { @@ -21215,7 +21215,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -21231,7 +21231,7 @@ class basic_json */ template::value, int> = 0> - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -21324,7 +21324,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -21340,7 +21340,7 @@ class basic_json */ template::value, int> = 0> - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -21412,7 +21412,7 @@ class basic_json @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -21428,7 +21428,7 @@ class basic_json */ template::value, int> = 0> - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -21499,7 +21499,7 @@ class basic_json @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the related UBJSON format */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -21515,7 +21515,7 @@ class basic_json */ template::value, int> = 0> - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -21889,7 +21889,7 @@ class basic_json else { const auto idx = json_pointer::array_index(last_path); - if (HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) { // avoid undefined behavior JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); @@ -21920,7 +21920,7 @@ class basic_json { // perform range check auto it = parent.find(last_path); - if (HEDLEY_LIKELY(it != parent.end())) + if (NLOHMANN_JSON_HEDLEY_LIKELY(it != parent.end())) { parent.erase(it); } @@ -21937,7 +21937,7 @@ class basic_json }; // type check: top level value must be an array - if (HEDLEY_UNLIKELY(not json_patch.is_array())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not json_patch.is_array())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -21957,13 +21957,13 @@ class basic_json const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; // check if desired value is present - if (HEDLEY_UNLIKELY(it == val.m_value.object->end())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); } // check if result is of type string - if (HEDLEY_UNLIKELY(string_type and not it->second.is_string())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(string_type and not it->second.is_string())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); } @@ -21973,7 +21973,7 @@ class basic_json }; // type check: every element of the array must be an object - if (HEDLEY_UNLIKELY(not val.is_object())) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not val.is_object())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -22051,7 +22051,7 @@ class basic_json } // throw an exception if test fails - if (HEDLEY_UNLIKELY(not success)) + if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not success)) { JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); } @@ -22104,7 +22104,7 @@ class basic_json @since version 2.0.0 */ - HEDLEY_WARN_UNUSED_RESULT + NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json diff(const basic_json& source, const basic_json& target, const std::string& path = "") { @@ -22396,7 +22396,7 @@ if no parse error occurred. @since version 1.0.0 */ -HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_NON_NULL(1) inline nlohmann::json operator "" _json(const char* s, std::size_t n) { return nlohmann::json::parse(s, s + n); @@ -22415,7 +22415,7 @@ object if no parse error occurred. @since version 2.0.0 */ -HEDLEY_NON_NULL(1) +NLOHMANN_JSON_HEDLEY_NON_NULL(1) inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) { return nlohmann::json::json_pointer(std::string(s, n)); @@ -22442,5 +22442,130 @@ inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std #undef NLOHMANN_BASIC_JSON_TPL_DECLARATION #undef NLOHMANN_BASIC_JSON_TPL +// #include +#undef NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE +#undef NLOHMANN_JSON_HEDLEY_ARM_VERSION +#undef NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_ARRAY_PARAM +#undef NLOHMANN_JSON_HEDLEY_ASSUME +#undef NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE +#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING +#undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION +#undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_CONCAT +#undef NLOHMANN_JSON_HEDLEY_CONCAT_EX +#undef NLOHMANN_JSON_HEDLEY_CONST +#undef NLOHMANN_JSON_HEDLEY_CONSTEXPR +#undef NLOHMANN_JSON_HEDLEY_CONST_CAST +#undef NLOHMANN_JSON_HEDLEY_CPP_CAST +#undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION +#undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_C_DECL +#undef NLOHMANN_JSON_HEDLEY_DEPRECATED +#undef NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH +#undef NLOHMANN_JSON_HEDLEY_DMC_VERSION +#undef NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION +#undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_END_C_DECLS +#undef NLOHMANN_JSON_HEDLEY_FALL_THROUGH +#undef NLOHMANN_JSON_HEDLEY_FLAGS +#undef NLOHMANN_JSON_HEDLEY_FLAGS_CAST +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE +#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING +#undef NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_GCC_VERSION +#undef NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE +#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING +#undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION +#undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_HAS_BUILTIN +#undef NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#undef NLOHMANN_JSON_HEDLEY_HAS_EXTENSION +#undef NLOHMANN_JSON_HEDLEY_HAS_FEATURE +#undef NLOHMANN_JSON_HEDLEY_HAS_WARNING +#undef NLOHMANN_JSON_HEDLEY_IAR_VERSION +#undef NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_IBM_VERSION +#undef NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_IMPORT +#undef NLOHMANN_JSON_HEDLEY_INLINE +#undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION +#undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_IS_CONSTANT +#undef NLOHMANN_JSON_HEDLEY_LIKELY +#undef NLOHMANN_JSON_HEDLEY_MALLOC +#undef NLOHMANN_JSON_HEDLEY_MESSAGE +#undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION +#undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_NEVER_INLINE +#undef NLOHMANN_JSON_HEDLEY_NON_NULL +#undef NLOHMANN_JSON_HEDLEY_NO_RETURN +#undef NLOHMANN_JSON_HEDLEY_NO_THROW +#undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION +#undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_PGI_VERSION +#undef NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_PREDICT +#undef NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT +#undef NLOHMANN_JSON_HEDLEY_PRIVATE +#undef NLOHMANN_JSON_HEDLEY_PUBLIC +#undef NLOHMANN_JSON_HEDLEY_PURE +#undef NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST +#undef NLOHMANN_JSON_HEDLEY_REQUIRE +#undef NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR +#undef NLOHMANN_JSON_HEDLEY_REQUIRE_MSG +#undef NLOHMANN_JSON_HEDLEY_RESTRICT +#undef NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +#undef NLOHMANN_JSON_HEDLEY_SENTINEL +#undef NLOHMANN_JSON_HEDLEY_STATIC_ASSERT +#undef NLOHMANN_JSON_HEDLEY_STATIC_CAST +#undef NLOHMANN_JSON_HEDLEY_STRINGIFY +#undef NLOHMANN_JSON_HEDLEY_STRINGIFY_EX +#undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION +#undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION +#undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_TI_VERSION +#undef NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK +#undef NLOHMANN_JSON_HEDLEY_UNAVAILABLE +#undef NLOHMANN_JSON_HEDLEY_UNLIKELY +#undef NLOHMANN_JSON_HEDLEY_UNPREDICTABLE +#undef NLOHMANN_JSON_HEDLEY_UNREACHABLE +#undef NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN +#undef NLOHMANN_JSON_HEDLEY_VERSION +#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR +#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR +#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION +#undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE +#undef NLOHMANN_JSON_HEDLEY_WARNING +#undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT +#undef NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR + + #endif // INCLUDE_NLOHMANN_JSON_HPP_ From 025f4cea424e9c9bb5e942307387aee463c2865a Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Mon, 1 Jul 2019 22:29:21 +0200 Subject: [PATCH 3/7] :rotating_light: fix warning --- Makefile | 2 +- include/nlohmann/thirdparty/hedley/hedley_undef.hpp | 1 - single_include/nlohmann/json.hpp | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 141e1c78..011c7c4d 100644 --- a/Makefile +++ b/Makefile @@ -621,5 +621,5 @@ update_hedley: rm -f include/nlohmann/thirdparty/hedley/hedley.hpp include/nlohmann/thirdparty/hedley/hedley_undef.hpp curl https://raw.githubusercontent.com/nemequ/hedley/master/hedley.h -o include/nlohmann/thirdparty/hedley/hedley.hpp gsed -i 's/HEDLEY_/NLOHMANN_JSON_HEDLEY_/g' include/nlohmann/thirdparty/hedley/hedley.hpp - grep "[[:blank:]]*#[[:blank:]]*undef" include/nlohmann/thirdparty/hedley/hedley.hpp | sort | uniq | gsed 's/ //g' | gsed 's/undef/undef /g' > include/nlohmann/thirdparty/hedley/hedley_undef.hpp + grep "[[:blank:]]*#[[:blank:]]*undef" include/nlohmann/thirdparty/hedley/hedley.hpp | grep -v "__" | sort | uniq | gsed 's/ //g' | gsed 's/undef/undef /g' > include/nlohmann/thirdparty/hedley/hedley_undef.hpp $(MAKE) amalgamate diff --git a/include/nlohmann/thirdparty/hedley/hedley_undef.hpp b/include/nlohmann/thirdparty/hedley/hedley_undef.hpp index 5458f064..5e95ae5a 100644 --- a/include/nlohmann/thirdparty/hedley/hedley_undef.hpp +++ b/include/nlohmann/thirdparty/hedley/hedley_undef.hpp @@ -119,4 +119,3 @@ #undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE #undef NLOHMANN_JSON_HEDLEY_WARNING #undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT -#undef NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 73a53ffb..6778fd41 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -22564,7 +22564,6 @@ inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std #undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE #undef NLOHMANN_JSON_HEDLEY_WARNING #undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT -#undef NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR From 90798caa627986c589b7a798c67bb9acc02f3de9 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Mon, 1 Jul 2019 22:37:30 +0200 Subject: [PATCH 4/7] :truck: rename Hedley macros --- Makefile | 6 +- .../nlohmann/detail/conversions/from_json.hpp | 24 +- .../nlohmann/detail/conversions/to_chars.hpp | 16 +- include/nlohmann/detail/exceptions.hpp | 12 +- .../nlohmann/detail/input/binary_reader.hpp | 116 +- .../nlohmann/detail/input/input_adapters.hpp | 10 +- include/nlohmann/detail/input/json_sax.hpp | 10 +- include/nlohmann/detail/input/lexer.hpp | 44 +- include/nlohmann/detail/input/parser.hpp | 48 +- .../nlohmann/detail/iterators/iter_impl.hpp | 12 +- include/nlohmann/detail/json_pointer.hpp | 34 +- .../nlohmann/detail/output/binary_writer.hpp | 2 +- .../detail/output/output_adapters.hpp | 6 +- include/nlohmann/detail/output/serializer.hpp | 6 +- include/nlohmann/json.hpp | 174 +- include/nlohmann/thirdparty/hedley/hedley.hpp | 1780 ++++++------ .../thirdparty/hedley/hedley_undef.hpp | 242 +- single_include/nlohmann/json.hpp | 2536 ++++++++--------- 18 files changed, 2541 insertions(+), 2537 deletions(-) diff --git a/Makefile b/Makefile index 011c7c4d..d64d42b2 100644 --- a/Makefile +++ b/Makefile @@ -617,9 +617,13 @@ clean: $(MAKE) clean -Cdoc $(MAKE) clean -Ctest +########################################################################## +# Thirdparty code +########################################################################## + update_hedley: rm -f include/nlohmann/thirdparty/hedley/hedley.hpp include/nlohmann/thirdparty/hedley/hedley_undef.hpp curl https://raw.githubusercontent.com/nemequ/hedley/master/hedley.h -o include/nlohmann/thirdparty/hedley/hedley.hpp - gsed -i 's/HEDLEY_/NLOHMANN_JSON_HEDLEY_/g' include/nlohmann/thirdparty/hedley/hedley.hpp + gsed -i 's/HEDLEY_/JSON_HEDLEY_/g' include/nlohmann/thirdparty/hedley/hedley.hpp grep "[[:blank:]]*#[[:blank:]]*undef" include/nlohmann/thirdparty/hedley/hedley.hpp | grep -v "__" | sort | uniq | gsed 's/ //g' | gsed 's/undef/undef /g' > include/nlohmann/thirdparty/hedley/hedley_undef.hpp $(MAKE) amalgamate diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index 4520041e..224fb33f 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -26,7 +26,7 @@ namespace detail template void from_json(const BasicJsonType& j, typename std::nullptr_t& n) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_null())) + if (JSON_HEDLEY_UNLIKELY(not j.is_null())) { JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); } @@ -66,7 +66,7 @@ void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) template void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_boolean())) + if (JSON_HEDLEY_UNLIKELY(not j.is_boolean())) { JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); } @@ -76,7 +76,7 @@ void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) template void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_string())) + if (JSON_HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -92,7 +92,7 @@ template < int > = 0 > void from_json(const BasicJsonType& j, ConstructibleStringType& s) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_string())) + if (JSON_HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -132,7 +132,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::forward_list& l) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -149,7 +149,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::valarray& l) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -236,7 +236,7 @@ auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) j.template get(), void()) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); @@ -249,7 +249,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_object())) + if (JSON_HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); } @@ -332,14 +332,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::map& m) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not p.is_array())) + if (JSON_HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -352,14 +352,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::unordered_map& m) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not p.is_array())) + if (JSON_HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } diff --git a/include/nlohmann/detail/conversions/to_chars.hpp b/include/nlohmann/detail/conversions/to_chars.hpp index 9a88937e..feafaec8 100644 --- a/include/nlohmann/detail/conversions/to_chars.hpp +++ b/include/nlohmann/detail/conversions/to_chars.hpp @@ -819,7 +819,7 @@ v = buf * 10^decimal_exponent len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_NON_NULL(1) inline void grisu2(char* buf, int& len, int& decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) { @@ -879,7 +879,7 @@ len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ template -NLOHMANN_JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_NON_NULL(1) void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) { static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, @@ -918,8 +918,8 @@ void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) @return a pointer to the element following the exponent. @pre -1000 < e < 1000 */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) -NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL inline char* append_exponent(char* buf, int e) { assert(e > -1000); @@ -970,8 +970,8 @@ notation. Otherwise it will be printed in exponential notation. @pre min_exp < 0 @pre max_exp > 0 */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) -NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL inline char* format_buffer(char* buf, int len, int decimal_exponent, int min_exp, int max_exp) { @@ -1055,8 +1055,8 @@ format. Returns an iterator pointing past-the-end of the decimal representation. @note The result is NOT null-terminated. */ template -NLOHMANN_JSON_HEDLEY_NON_NULL(1, 2) -NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +JSON_HEDLEY_NON_NULL(1, 2) +JSON_HEDLEY_RETURNS_NON_NULL char* to_chars(char* first, const char* last, FloatType value) { static_cast(last); // maybe unused - fix warning diff --git a/include/nlohmann/detail/exceptions.hpp b/include/nlohmann/detail/exceptions.hpp index ad9673b6..ed836188 100644 --- a/include/nlohmann/detail/exceptions.hpp +++ b/include/nlohmann/detail/exceptions.hpp @@ -47,7 +47,7 @@ class exception : public std::exception { public: /// returns the explanatory string - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL const char* what() const noexcept override { return m.what(); @@ -57,7 +57,7 @@ class exception : public std::exception const int id; protected: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} static std::string name(const std::string& ename, int id_) @@ -210,7 +210,7 @@ class invalid_iterator : public exception } private: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) invalid_iterator(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -264,7 +264,7 @@ class type_error : public exception } private: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -311,7 +311,7 @@ class out_of_range : public exception } private: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -349,7 +349,7 @@ class other_error : public exception } private: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; } // namespace detail diff --git a/include/nlohmann/detail/input/binary_reader.hpp b/include/nlohmann/detail/input/binary_reader.hpp index 48ad8c00..e44249ea 100644 --- a/include/nlohmann/detail/input/binary_reader.hpp +++ b/include/nlohmann/detail/input/binary_reader.hpp @@ -66,7 +66,7 @@ class binary_reader @return */ - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) bool sax_parse(const input_format_t format, json_sax_t* sax_, const bool strict = true) @@ -108,7 +108,7 @@ class binary_reader get(); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current != std::char_traits::eof())) + if (JSON_HEDLEY_UNLIKELY(current != std::char_traits::eof())) { return sax->parse_error(chars_read, get_token_string(), parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); @@ -144,12 +144,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) { return false; } @@ -170,7 +170,7 @@ class binary_reader while (true) { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) { return false; } @@ -198,7 +198,7 @@ class binary_reader template bool get_bson_string(const NumberType len, string_t& result) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len < 1)) + if (JSON_HEDLEY_UNLIKELY(len < 1)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); @@ -293,13 +293,13 @@ class binary_reader string_t key; while (int element_type = get()) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) { return false; } const std::size_t element_type_parse_position = chars_read; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_bson_cstr(key))) + if (JSON_HEDLEY_UNLIKELY(not get_bson_cstr(key))) { return false; } @@ -309,7 +309,7 @@ class binary_reader return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) { return false; } @@ -330,12 +330,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) { return false; } @@ -620,12 +620,12 @@ class binary_reader case 0xF9: // Half-Precision Float (two-byte IEEE 754) { const int byte1_raw = get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } const int byte2_raw = get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } @@ -698,7 +698,7 @@ class binary_reader */ bool get_cbor_string(string_t& result) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) { return false; } @@ -787,7 +787,7 @@ class binary_reader */ bool get_cbor_array(const std::size_t len) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } @@ -796,7 +796,7 @@ class binary_reader { for (std::size_t i = 0; i < len; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -806,7 +806,7 @@ class binary_reader { while (get() != 0xFF) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal(false))) + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal(false))) { return false; } @@ -823,7 +823,7 @@ class binary_reader */ bool get_cbor_object(const std::size_t len) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -834,12 +834,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -850,12 +850,12 @@ class binary_reader { while (get() != 0xFF) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -1244,7 +1244,7 @@ class binary_reader */ bool get_msgpack_string(string_t& result) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) { return false; } @@ -1320,14 +1320,14 @@ class binary_reader */ bool get_msgpack_array(const std::size_t len) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } for (std::size_t i = 0; i < len; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -1342,7 +1342,7 @@ class binary_reader */ bool get_msgpack_object(const std::size_t len) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -1351,12 +1351,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -1403,7 +1403,7 @@ class binary_reader get(); // TODO(niels): may we ignore N here? } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -1457,7 +1457,7 @@ class binary_reader case 'U': { std::uint8_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1468,7 +1468,7 @@ class binary_reader case 'i': { std::int8_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1479,7 +1479,7 @@ class binary_reader case 'I': { std::int16_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1490,7 +1490,7 @@ class binary_reader case 'l': { std::int32_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1501,7 +1501,7 @@ class binary_reader case 'L': { std::int64_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -1537,15 +1537,15 @@ class binary_reader if (current == '$') { result.second = get(); // must not ignore 'N', because 'N' maybe the type - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) { return false; } get_ignore_noop(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current != '#')) + if (JSON_HEDLEY_UNLIKELY(current != '#')) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -1628,11 +1628,11 @@ class binary_reader case 'C': // char { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current > 127)) + if (JSON_HEDLEY_UNLIKELY(current > 127)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); @@ -1667,14 +1667,14 @@ class binary_reader bool get_ubjson_array() { std::pair size_and_type; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } if (size_and_type.first != string_t::npos) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) { return false; } @@ -1685,7 +1685,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -1696,7 +1696,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1705,14 +1705,14 @@ class binary_reader } else { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } while (current != ']') { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) { return false; } @@ -1729,7 +1729,7 @@ class binary_reader bool get_ubjson_object() { std::pair size_and_type; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } @@ -1737,7 +1737,7 @@ class binary_reader string_t key; if (size_and_type.first != string_t::npos) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) { return false; } @@ -1746,11 +1746,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -1761,11 +1761,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1775,18 +1775,18 @@ class binary_reader } else { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } while (current != '}') { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -1852,7 +1852,7 @@ class binary_reader for (std::size_t i = 0; i < sizeof(NumberType); ++i) { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) { return false; } @@ -1896,7 +1896,7 @@ class binary_reader std::generate_n(std::back_inserter(result), len, [this, &success, &format]() { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) { success = false; } @@ -1910,10 +1910,10 @@ class binary_reader @param[in] context further context information (for diagnostics) @return whether the last read character is not EOF */ - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) bool unexpect_eof(const input_format_t format, const char* context) const { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current == std::char_traits::eof())) + if (JSON_HEDLEY_UNLIKELY(current == std::char_traits::eof())) { return sax->parse_error(chars_read, "", parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index 55b2931c..b7b11de0 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -55,7 +55,7 @@ Input adapter for stdio file access. This adapter read only 1 byte and do not us class file_input_adapter : public input_adapter_protocol { public: - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) explicit file_input_adapter(std::FILE* f) noexcept : m_file(f) {} @@ -131,7 +131,7 @@ class input_stream_adapter : public input_adapter_protocol class input_buffer_adapter : public input_adapter_protocol { public: - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) input_buffer_adapter(const char* b, const std::size_t l) noexcept : cursor(b), limit(b + l) {} @@ -145,7 +145,7 @@ class input_buffer_adapter : public input_adapter_protocol std::char_traits::int_type get_character() noexcept override { - if (NLOHMANN_JSON_HEDLEY_LIKELY(cursor < limit)) + if (JSON_HEDLEY_LIKELY(cursor < limit)) { return std::char_traits::to_int_type(*(cursor++)); } @@ -335,7 +335,7 @@ class input_adapter { public: // native support - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) input_adapter(std::FILE* file) : ia(std::make_shared(file)) {} /// input adapter for input stream @@ -404,7 +404,7 @@ class input_adapter "each element in the iterator range must have the size of 1 byte"); const auto len = static_cast(std::distance(first, last)); - if (NLOHMANN_JSON_HEDLEY_LIKELY(len > 0)) + if (JSON_HEDLEY_LIKELY(len > 0)) { // there is at least one element: use the address of first ia = std::make_shared(reinterpret_cast(&(*first)), len); diff --git a/include/nlohmann/detail/input/json_sax.hpp b/include/nlohmann/detail/input/json_sax.hpp index 65e48b31..606b7862 100644 --- a/include/nlohmann/detail/input/json_sax.hpp +++ b/include/nlohmann/detail/input/json_sax.hpp @@ -206,7 +206,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); @@ -232,7 +232,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); @@ -288,7 +288,7 @@ class json_sax_dom_parser object to which we can add elements */ template - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL BasicJsonType* handle_value(Value&& v) { if (ref_stack.empty()) @@ -395,7 +395,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check object limit - if (ref_stack.back() and NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); } @@ -458,7 +458,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check array limit - if (ref_stack.back() and NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); } diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index 21e37d4b..d19836cb 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -59,7 +59,7 @@ class lexer }; /// return name of values of type token_type (only used for errors) - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL static const char* token_type_name(const token_type t) noexcept { switch (t) @@ -201,7 +201,7 @@ class lexer for (auto range = ranges.begin(); range != ranges.end(); ++range) { get(); - if (NLOHMANN_JSON_HEDLEY_LIKELY(*range <= current and current <= *(++range))) + if (JSON_HEDLEY_LIKELY(*range <= current and current <= *(++range))) { add(current); } @@ -300,7 +300,7 @@ class lexer const int codepoint1 = get_codepoint(); int codepoint = codepoint1; // start with codepoint1 - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) + if (JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; @@ -310,18 +310,18 @@ class lexer if (0xD800 <= codepoint1 and codepoint1 <= 0xDBFF) { // expect next \uxxxx entry - if (NLOHMANN_JSON_HEDLEY_LIKELY(get() == '\\' and get() == 'u')) + if (JSON_HEDLEY_LIKELY(get() == '\\' and get() == 'u')) { const int codepoint2 = get_codepoint(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) + if (JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; } // check if codepoint2 is a low surrogate - if (NLOHMANN_JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) + if (JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) { // overwrite codepoint codepoint = static_cast( @@ -348,7 +348,7 @@ class lexer } else { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) + if (JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) { error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; return token_type::parse_error; @@ -723,7 +723,7 @@ class lexer case 0xDE: case 0xDF: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) + if (JSON_HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) { return token_type::parse_error; } @@ -733,7 +733,7 @@ class lexer // U+0800..U+0FFF: bytes E0 A0..BF 80..BF case 0xE0: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -757,7 +757,7 @@ class lexer case 0xEE: case 0xEF: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -767,7 +767,7 @@ class lexer // U+D000..U+D7FF: bytes ED 80..9F 80..BF case 0xED: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -777,7 +777,7 @@ class lexer // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF case 0xF0: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -789,7 +789,7 @@ class lexer case 0xF2: case 0xF3: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -799,7 +799,7 @@ class lexer // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF case 0xF4: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -816,19 +816,19 @@ class lexer } } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); @@ -1204,14 +1204,14 @@ scan_number_done: @param[in] length the length of the passed literal text @param[in] return_type the token type to return on success */ - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) token_type scan_literal(const char* literal_text, const std::size_t length, token_type return_type) { assert(current == literal_text[0]); for (std::size_t i = 1; i < length; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get() != literal_text[i])) + if (JSON_HEDLEY_UNLIKELY(get() != literal_text[i])) { error_message = "invalid literal"; return token_type::parse_error; @@ -1257,7 +1257,7 @@ scan_number_done: current = ia->get_character(); } - if (NLOHMANN_JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) + if (JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) { token_string.push_back(std::char_traits::to_char_type(current)); } @@ -1298,7 +1298,7 @@ scan_number_done: --position.chars_read_current_line; } - if (NLOHMANN_JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) + if (JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) { assert(not token_string.empty()); token_string.pop_back(); @@ -1377,7 +1377,7 @@ scan_number_done: } /// return syntax error message - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL constexpr const char* get_error_message() const noexcept { return error_message; diff --git a/include/nlohmann/detail/input/parser.hpp b/include/nlohmann/detail/input/parser.hpp index 2e3f3b62..8d4febcb 100644 --- a/include/nlohmann/detail/input/parser.hpp +++ b/include/nlohmann/detail/input/parser.hpp @@ -147,7 +147,7 @@ class parser } template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) bool sax_parse(SAX* sax, const bool strict = true) { (void)detail::is_sax_static_asserts {}; @@ -167,7 +167,7 @@ class parser private: template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) bool sax_parse_internal(SAX* sax) { // stack to remember the hierarchy of structured values we are parsing @@ -185,7 +185,7 @@ class parser { case token_type::begin_object: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } @@ -193,7 +193,7 @@ class parser // closing } -> we are done if (get_token() == token_type::end_object) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_object())) + if (JSON_HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -201,20 +201,20 @@ class parser } // parse key - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) + if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"))); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -232,7 +232,7 @@ class parser case token_type::begin_array: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } @@ -240,7 +240,7 @@ class parser // closing ] -> we are done if (get_token() == token_type::end_array) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_array())) + if (JSON_HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -258,14 +258,14 @@ class parser { const auto res = m_lexer.get_number_float(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not std::isfinite(res))) + if (JSON_HEDLEY_UNLIKELY(not std::isfinite(res))) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) + if (JSON_HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) { return false; } @@ -275,7 +275,7 @@ class parser case token_type::literal_false: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->boolean(false))) + if (JSON_HEDLEY_UNLIKELY(not sax->boolean(false))) { return false; } @@ -284,7 +284,7 @@ class parser case token_type::literal_null: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->null())) + if (JSON_HEDLEY_UNLIKELY(not sax->null())) { return false; } @@ -293,7 +293,7 @@ class parser case token_type::literal_true: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->boolean(true))) + if (JSON_HEDLEY_UNLIKELY(not sax->boolean(true))) { return false; } @@ -302,7 +302,7 @@ class parser case token_type::value_integer: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) + if (JSON_HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) { return false; } @@ -311,7 +311,7 @@ class parser case token_type::value_string: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) + if (JSON_HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) { return false; } @@ -320,7 +320,7 @@ class parser case token_type::value_unsigned: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) + if (JSON_HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) { return false; } @@ -368,9 +368,9 @@ class parser } // closing ] - if (NLOHMANN_JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_array())) + if (JSON_HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -396,7 +396,7 @@ class parser if (get_token() == token_type::value_separator) { // parse key - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -404,13 +404,13 @@ class parser exception_message(token_type::value_string, "object key"))); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -424,9 +424,9 @@ class parser } // closing } - if (NLOHMANN_JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_object())) + if (JSON_HEDLEY_UNLIKELY(not sax->end_object())) { return false; } diff --git a/include/nlohmann/detail/iterators/iter_impl.hpp b/include/nlohmann/detail/iterators/iter_impl.hpp index 887bcce4..f41d9517 100644 --- a/include/nlohmann/detail/iterators/iter_impl.hpp +++ b/include/nlohmann/detail/iterators/iter_impl.hpp @@ -255,7 +255,7 @@ class iter_impl default: { - if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return *m_object; } @@ -289,7 +289,7 @@ class iter_impl default: { - if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return m_object; } @@ -392,7 +392,7 @@ class iter_impl bool operator==(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -428,7 +428,7 @@ class iter_impl bool operator<(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -588,7 +588,7 @@ class iter_impl default: { - if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) { return *m_object; } @@ -606,7 +606,7 @@ class iter_impl { assert(m_object != nullptr); - if (NLOHMANN_JSON_HEDLEY_LIKELY(m_object->is_object())) + if (JSON_HEDLEY_LIKELY(m_object->is_object())) { return m_it.object_iterator->first; } diff --git a/include/nlohmann/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp index 609b433f..53118b2e 100644 --- a/include/nlohmann/detail/json_pointer.hpp +++ b/include/nlohmann/detail/json_pointer.hpp @@ -244,7 +244,7 @@ class json_pointer */ void pop_back() { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) + if (JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -268,7 +268,7 @@ class json_pointer */ const std::string& back() { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) + if (JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -332,7 +332,7 @@ class json_pointer const int res = std::stoi(s, &processed_chars); // check if the string was completely read - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) + if (JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) { JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); } @@ -342,7 +342,7 @@ class json_pointer json_pointer top() const { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) + if (JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -474,7 +474,7 @@ class json_pointer case detail::value_t::array: { // error condition (cf. RFC 6901, Sect. 4) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -532,7 +532,7 @@ class json_pointer case detail::value_t::array: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -541,7 +541,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -597,7 +597,7 @@ class json_pointer case detail::value_t::array: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" cannot be used for const access JSON_THROW(detail::out_of_range::create(402, @@ -606,7 +606,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -656,7 +656,7 @@ class json_pointer case detail::value_t::array: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -665,7 +665,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -712,7 +712,7 @@ class json_pointer } // check if nonempty reference string begins with slash - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) + if (JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) { JSON_THROW(detail::parse_error::create(107, 1, "JSON pointer must be empty or begin with '/' - was: '" + @@ -747,9 +747,9 @@ class json_pointer assert(reference_token[pos] == '~'); // ~ must be followed by 0 or 1 - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or - (reference_token[pos + 1] != '0' and - reference_token[pos + 1] != '1'))) + if (JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or + (reference_token[pos + 1] != '0' and + reference_token[pos + 1] != '1'))) { JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); } @@ -874,7 +874,7 @@ class json_pointer static BasicJsonType unflatten(const BasicJsonType& value) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not value.is_object())) + if (JSON_HEDLEY_UNLIKELY(not value.is_object())) { JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); } @@ -884,7 +884,7 @@ class json_pointer // iterate the JSON object values for (const auto& element : *value.m_value.object) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not element.second.is_primitive())) + if (JSON_HEDLEY_UNLIKELY(not element.second.is_primitive())) { JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); } diff --git a/include/nlohmann/detail/output/binary_writer.hpp b/include/nlohmann/detail/output/binary_writer.hpp index f09d151e..b0ab62d1 100644 --- a/include/nlohmann/detail/output/binary_writer.hpp +++ b/include/nlohmann/detail/output/binary_writer.hpp @@ -715,7 +715,7 @@ class binary_writer static std::size_t calc_bson_entry_header_size(const string_t& name) { const auto it = name.find(static_cast(0)); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) + if (JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) { JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index 1354a814..71ca65b9 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -40,7 +40,7 @@ class output_vector_adapter : public output_adapter_protocol v.push_back(c); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { std::copy(s, s + length, std::back_inserter(v)); @@ -64,7 +64,7 @@ class output_stream_adapter : public output_adapter_protocol stream.put(c); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { stream.write(s, static_cast(length)); @@ -88,7 +88,7 @@ class output_string_adapter : public output_adapter_protocol str.push_back(c); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { str.append(s, length); diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index 7c0a681c..e6811ceb 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -110,7 +110,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -183,7 +183,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -498,7 +498,7 @@ class serializer } // we finished processing the string - if (NLOHMANN_JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) + if (JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) { // write buffer if (bytes > 0) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index ab8dd2e9..60f31135 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -319,7 +319,7 @@ class basic_json @since 2.1.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json meta() { basic_json result; @@ -824,7 +824,7 @@ class basic_json /// helper for exception-safe object creation template - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL static T* create(Args&& ... args) { AllocatorType alloc; @@ -951,7 +951,7 @@ class basic_json default: { object = nullptr; // silence warning, see #821 - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(t == value_t::null)) + if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) { JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.6.1")); // LCOV_EXCL_LINE } @@ -1428,7 +1428,7 @@ class basic_json } // if object is wanted but impossible, throw an exception - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) + if (JSON_HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) { JSON_THROW(type_error::create(301, "cannot create object from initializer list")); } @@ -1495,7 +1495,7 @@ class basic_json @since version 1.0.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json array(initializer_list_t init = {}) { return basic_json(init, false, value_t::array); @@ -1539,7 +1539,7 @@ class basic_json @since version 1.0.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json object(initializer_list_t init = {}) { return basic_json(init, false, value_t::object); @@ -1638,7 +1638,7 @@ class basic_json assert(last.m_object != nullptr); // make sure iterator fits the current value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); } @@ -1655,8 +1655,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (JSON_HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -2369,7 +2369,7 @@ class basic_json /// get a boolean (explicit) boolean_t get_impl(boolean_t* /*unused*/) const { - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_boolean())) + if (JSON_HEDLEY_LIKELY(is_boolean())) { return m_value.boolean; } @@ -2478,7 +2478,7 @@ class basic_json // delegate the call to get_ptr<>() auto ptr = obj.template get_ptr::type>(); - if (NLOHMANN_JSON_HEDLEY_LIKELY(ptr != nullptr)) + if (JSON_HEDLEY_LIKELY(ptr != nullptr)) { return *ptr; } @@ -2929,7 +2929,7 @@ class basic_json reference at(size_type idx) { // at only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -2976,7 +2976,7 @@ class basic_json const_reference at(size_type idx) const { // at only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -3027,7 +3027,7 @@ class basic_json reference at(const typename object_t::key_type& key) { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -3078,7 +3078,7 @@ class basic_json const_reference at(const typename object_t::key_type& key) const { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -3132,7 +3132,7 @@ class basic_json } // operator[] only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { // fill up array with null values if given idx is outside range if (idx >= m_value.array->size()) @@ -3170,7 +3170,7 @@ class basic_json const_reference operator[](size_type idx) const { // const operator[] only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { return m_value.array->operator[](idx); } @@ -3216,7 +3216,7 @@ class basic_json } // operator[] only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -3257,7 +3257,7 @@ class basic_json const_reference operator[](const typename object_t::key_type& key) const { // const operator[] only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -3294,7 +3294,7 @@ class basic_json @since version 1.1.0 */ template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) reference operator[](T* key) { // implicitly convert null to object @@ -3306,7 +3306,7 @@ class basic_json } // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -3345,11 +3345,11 @@ class basic_json @since version 1.1.0 */ template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) const_reference operator[](T* key) const { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -3413,7 +3413,7 @@ class basic_json ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { // if key is found, return value and given default value otherwise const auto it = find(key); @@ -3485,7 +3485,7 @@ class basic_json ValueType value(const json_pointer& ptr, const ValueType& default_value) const { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { // if pointer resolves a value, return it or use default value JSON_TRY @@ -3505,7 +3505,7 @@ class basic_json @brief overload for a default value of type const char* @copydoc basic_json::value(const json_pointer&, ValueType) const */ - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) string_t value(const json_pointer& ptr, const char* default_value) const { return value(ptr, string_t(default_value)); @@ -3650,7 +3650,7 @@ class basic_json IteratorType erase(IteratorType pos) { // make sure iterator fits the current value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(this != pos.m_object)) + if (JSON_HEDLEY_UNLIKELY(this != pos.m_object)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -3665,7 +3665,7 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) + if (JSON_HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) { JSON_THROW(invalid_iterator::create(205, "iterator out of range")); } @@ -3755,7 +3755,7 @@ class basic_json IteratorType erase(IteratorType first, IteratorType last) { // make sure iterator fits the current value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) { JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); } @@ -3770,8 +3770,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (NLOHMANN_JSON_HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (JSON_HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -3842,7 +3842,7 @@ class basic_json size_type erase(const typename object_t::key_type& key) { // this erase only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->erase(key); } @@ -3877,9 +3877,9 @@ class basic_json void erase(const size_type idx) { // this erase only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(idx >= size())) + if (JSON_HEDLEY_UNLIKELY(idx >= size())) { JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); } @@ -4355,7 +4355,7 @@ class basic_json future 4.0.0 of the library. Please use @ref items() instead; that is, replace `json::iterator_wrapper(j)` with `j.items()`. */ - NLOHMANN_JSON_HEDLEY_DEPRECATED(3.1.0) + JSON_HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(reference ref) noexcept { return ref.items(); @@ -4364,7 +4364,7 @@ class basic_json /*! @copydoc iterator_wrapper(reference) */ - NLOHMANN_JSON_HEDLEY_DEPRECATED(3.1.0) + JSON_HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(const_reference ref) noexcept { return ref.items(); @@ -4783,7 +4783,7 @@ class basic_json void push_back(basic_json&& val) { // push_back only works for null objects or arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4820,7 +4820,7 @@ class basic_json void push_back(const basic_json& val) { // push_back only works for null objects or arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4870,7 +4870,7 @@ class basic_json void push_back(const typename object_t::value_type& val) { // push_back only works for null objects or objects - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -4971,7 +4971,7 @@ class basic_json void emplace_back(Args&& ... args) { // emplace_back only works for null objects or arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); } @@ -5019,7 +5019,7 @@ class basic_json std::pair emplace(Args&& ... args) { // emplace only works for null objects or arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); } @@ -5087,10 +5087,10 @@ class basic_json iterator insert(const_iterator pos, const basic_json& val) { // insert only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5138,10 +5138,10 @@ class basic_json iterator insert(const_iterator pos, size_type cnt, const basic_json& val) { // insert only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5186,24 +5186,24 @@ class basic_json iterator insert(const_iterator pos, const_iterator first, const_iterator last) { // insert only works for arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_array())) + if (JSON_HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } // check if range iterators belong to the same JSON object - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object == this)) + if (JSON_HEDLEY_UNLIKELY(first.m_object == this)) { JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); } @@ -5239,13 +5239,13 @@ class basic_json iterator insert(const_iterator pos, initializer_list_t ilist) { // insert only works for arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_array())) + if (JSON_HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -5280,19 +5280,19 @@ class basic_json void insert(const_iterator first, const_iterator last) { // insert only works for objects - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) + if (JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_object->is_object())) + if (JSON_HEDLEY_UNLIKELY(not first.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -5329,11 +5329,11 @@ class basic_json assert_invariant(); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) + if (JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_object())) + if (JSON_HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); } @@ -5380,20 +5380,20 @@ class basic_json assert_invariant(); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) + if (JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_object->is_object() - or not last.m_object->is_object())) + if (JSON_HEDLEY_UNLIKELY(not first.m_object->is_object() + or not last.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -5456,7 +5456,7 @@ class basic_json void swap(array_t& other) { // swap only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { std::swap(*(m_value.array), other); } @@ -5489,7 +5489,7 @@ class basic_json void swap(object_t& other) { // swap only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { std::swap(*(m_value.object), other); } @@ -5522,7 +5522,7 @@ class basic_json void swap(string_t& other) { // swap only works for strings - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_string())) + if (JSON_HEDLEY_LIKELY(is_string())) { std::swap(*(m_value.string), other); } @@ -6032,7 +6032,7 @@ class basic_json instead; that is, replace calls like `j >> o;` with `o << j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - NLOHMANN_JSON_HEDLEY_DEPRECATED(3.0.0) + JSON_HEDLEY_DEPRECATED(3.0.0) friend std::ostream& operator>>(const basic_json& j, std::ostream& o) { return o << j; @@ -6111,7 +6111,7 @@ class basic_json @since version 2.0.3 (contiguous containers) */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json parse(detail::input_adapter&& i, const parser_callback_t cb = nullptr, const bool allow_exceptions = true) @@ -6180,7 +6180,7 @@ class basic_json @since version 3.2.0 */ template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) static bool sax_parse(detail::input_adapter&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true) @@ -6266,7 +6266,7 @@ class basic_json std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits::iterator_category>::value, int>::type = 0> - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) static bool sax_parse(IteratorType first, IteratorType last, SAX* sax) { return parser(detail::input_adapter(first, last)).sax_parse(sax); @@ -6280,7 +6280,7 @@ class basic_json instead; that is, replace calls like `j << i;` with `i >> j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - NLOHMANN_JSON_HEDLEY_DEPRECATED(3.0.0) + JSON_HEDLEY_DEPRECATED(3.0.0) friend std::istream& operator<<(basic_json& j, std::istream& i) { return operator>>(i, j); @@ -6353,7 +6353,7 @@ class basic_json @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` since 3.0.0 */ - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL const char* type_name() const noexcept { { @@ -6883,7 +6883,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -6899,7 +6899,7 @@ class basic_json */ template::value, int> = 0> - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -6992,7 +6992,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7008,7 +7008,7 @@ class basic_json */ template::value, int> = 0> - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7080,7 +7080,7 @@ class basic_json @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7096,7 +7096,7 @@ class basic_json */ template::value, int> = 0> - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7167,7 +7167,7 @@ class basic_json @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the related UBJSON format */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -7183,7 +7183,7 @@ class basic_json */ template::value, int> = 0> - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -7557,7 +7557,7 @@ class basic_json else { const auto idx = json_pointer::array_index(last_path); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) + if (JSON_HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) { // avoid undefined behavior JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); @@ -7588,7 +7588,7 @@ class basic_json { // perform range check auto it = parent.find(last_path); - if (NLOHMANN_JSON_HEDLEY_LIKELY(it != parent.end())) + if (JSON_HEDLEY_LIKELY(it != parent.end())) { parent.erase(it); } @@ -7605,7 +7605,7 @@ class basic_json }; // type check: top level value must be an array - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not json_patch.is_array())) + if (JSON_HEDLEY_UNLIKELY(not json_patch.is_array())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -7625,13 +7625,13 @@ class basic_json const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; // check if desired value is present - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) + if (JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); } // check if result is of type string - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(string_type and not it->second.is_string())) + if (JSON_HEDLEY_UNLIKELY(string_type and not it->second.is_string())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); } @@ -7641,7 +7641,7 @@ class basic_json }; // type check: every element of the array must be an object - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not val.is_object())) + if (JSON_HEDLEY_UNLIKELY(not val.is_object())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -7719,7 +7719,7 @@ class basic_json } // throw an exception if test fails - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not success)) + if (JSON_HEDLEY_UNLIKELY(not success)) { JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); } @@ -7772,7 +7772,7 @@ class basic_json @since version 2.0.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json diff(const basic_json& source, const basic_json& target, const std::string& path = "") { @@ -8064,7 +8064,7 @@ if no parse error occurred. @since version 1.0.0 */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_NON_NULL(1) inline nlohmann::json operator "" _json(const char* s, std::size_t n) { return nlohmann::json::parse(s, s + n); @@ -8083,7 +8083,7 @@ object if no parse error occurred. @since version 2.0.0 */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_NON_NULL(1) inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) { return nlohmann::json::json_pointer(std::string(s, n)); diff --git a/include/nlohmann/thirdparty/hedley/hedley.hpp b/include/nlohmann/thirdparty/hedley/hedley.hpp index 31d63a6b..453e6488 100644 --- a/include/nlohmann/thirdparty/hedley/hedley.hpp +++ b/include/nlohmann/thirdparty/hedley/hedley.hpp @@ -10,1257 +10,1257 @@ * SPDX-License-Identifier: CC0-1.0 */ -#if !defined(NLOHMANN_JSON_HEDLEY_VERSION) || (NLOHMANN_JSON_HEDLEY_VERSION < 9) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION) - #undef NLOHMANN_JSON_HEDLEY_VERSION +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 9) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION #endif -#define NLOHMANN_JSON_HEDLEY_VERSION 9 +#define JSON_HEDLEY_VERSION 9 -#if defined(NLOHMANN_JSON_HEDLEY_STRINGIFY_EX) - #undef NLOHMANN_JSON_HEDLEY_STRINGIFY_EX +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX #endif -#define NLOHMANN_JSON_HEDLEY_STRINGIFY_EX(x) #x +#define JSON_HEDLEY_STRINGIFY_EX(x) #x -#if defined(NLOHMANN_JSON_HEDLEY_STRINGIFY) - #undef NLOHMANN_JSON_HEDLEY_STRINGIFY +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY #endif -#define NLOHMANN_JSON_HEDLEY_STRINGIFY(x) NLOHMANN_JSON_HEDLEY_STRINGIFY_EX(x) +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) -#if defined(NLOHMANN_JSON_HEDLEY_CONCAT_EX) - #undef NLOHMANN_JSON_HEDLEY_CONCAT_EX +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX #endif -#define NLOHMANN_JSON_HEDLEY_CONCAT_EX(a,b) a##b +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b -#if defined(NLOHMANN_JSON_HEDLEY_CONCAT) - #undef NLOHMANN_JSON_HEDLEY_CONCAT +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT #endif -#define NLOHMANN_JSON_HEDLEY_CONCAT(a,b) NLOHMANN_JSON_HEDLEY_CONCAT_EX(a,b) +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION_ENCODE) - #undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE #endif -#define NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR) - #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR #endif -#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR) - #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR #endif -#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION) - #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION #endif -#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION #endif #if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) - #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) #elif defined(__GNUC__) - #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) - #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_GNUC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_MSVC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION #endif #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) #elif defined(_MSC_FULL_VER) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) #elif defined(_MSC_VER) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK #endif #if !defined(_MSC_VER) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) #elif defined(_MSC_VER) && (_MSC_VER >= 1400) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) #elif defined(_MSC_VER) && (_MSC_VER >= 1200) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) #else - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) #endif -#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) - #undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION #endif #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) - #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) #elif defined(__INTEL_COMPILER) - #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) - #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_INTEL_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) - #undef NLOHMANN_JSON_HEDLEY_PGI_VERSION +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION #endif #if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) - #define NLOHMANN_JSON_HEDLEY_PGI_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) #endif -#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) - #define NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_PGI_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) - #undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION #endif #if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) #elif defined(__SUNPRO_C) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) #elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) #elif defined(__SUNPRO_CC) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) #endif -#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION) - #undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION #endif #if defined(__EMSCRIPTEN__) - #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) #endif -#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION) - #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) - #undef NLOHMANN_JSON_HEDLEY_ARM_VERSION +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION #endif #if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) - #define NLOHMANN_JSON_HEDLEY_ARM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) #elif defined(__CC_ARM) && defined(__ARMCC_VERSION) - #define NLOHMANN_JSON_HEDLEY_ARM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) #endif -#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) - #define NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_ARM_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION) - #undef NLOHMANN_JSON_HEDLEY_IBM_VERSION +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION #endif #if defined(__ibmxl__) - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) #elif defined(__xlC__) && defined(__xlC_ver__) - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) #elif defined(__xlC__) - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION) - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_IBM_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) - #undef NLOHMANN_JSON_HEDLEY_TI_VERSION +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION #endif #if defined(__TI_COMPILER_VERSION__) - #define NLOHMANN_JSON_HEDLEY_TI_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) #endif -#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) - #define NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_TI_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION) - #undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION #endif #if defined(_CRAYC) #if defined(_RELEASE_PATCHLEVEL) - #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) #else - #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) #endif #endif -#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION) - #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_CRAY_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION) - #undef NLOHMANN_JSON_HEDLEY_IAR_VERSION +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION #endif #if defined(__IAR_SYSTEMS_ICC__) #if __VER__ > 1000 - #define NLOHMANN_JSON_HEDLEY_IAR_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) #else - #define NLOHMANN_JSON_HEDLEY_IAR_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) #endif #endif -#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION) - #define NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_IAR_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION #endif #if defined(__TINYC__) - #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) #endif -#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) - #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_TINYC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_DMC_VERSION +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION #endif #if defined(__DMC__) - #define NLOHMANN_JSON_HEDLEY_DMC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) #endif -#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION) - #define NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_DMC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION) - #undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION #endif #if defined(__COMPCERT_VERSION__) - #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) #endif -#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION) - #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION) - #undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION #endif #if defined(__POCC__) - #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION) - #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_PELLES_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_GCC_VERSION +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION #endif #if \ - defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) && \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ !defined(__clang__) && \ - !defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) && \ - !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) && \ - !defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) && \ - !defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ !defined(__COMPCERT__) - #define NLOHMANN_JSON_HEDLEY_GCC_VERSION NLOHMANN_JSON_HEDLEY_GNUC_VERSION + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) - #define NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_GCC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_BUILTIN) - #undef NLOHMANN_JSON_HEDLEY_HAS_BUILTIN +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN #endif #if defined(__has_builtin) - #define NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) #else - #define NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) (0) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN #endif #if defined(__has_builtin) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN #endif #if defined(__has_builtin) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_FEATURE) - #undef NLOHMANN_JSON_HEDLEY_HAS_FEATURE +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE #endif #if defined(__has_feature) - #define NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) #else - #define NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) (0) + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE #endif #if defined(__has_feature) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE #endif #if defined(__has_feature) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_EXTENSION) - #undef NLOHMANN_JSON_HEDLEY_HAS_EXTENSION +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION #endif #if defined(__has_extension) - #define NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) #else - #define NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) (0) + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION #endif #if defined(__has_extension) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION #endif #if defined(__has_extension) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_WARNING) - #undef NLOHMANN_JSON_HEDLEY_HAS_WARNING +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING #endif #if defined(__has_warning) - #define NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) #else - #define NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) (0) + #define JSON_HEDLEY_HAS_WARNING(warning) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING #endif #if defined(__has_warning) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING #endif #if defined(__has_warning) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif #if \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ defined(__clang__) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) || \ - NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ - NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) - #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) _Pragma(#value) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) __pragma(value) + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) #else - #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) + #define JSON_HEDLEY_PRAGMA(value) #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP #endif #if defined(__clang__) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") -#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) -#elif NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,1,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif JSON_HEDLEY_TI_VERSION_CHECK(8,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") #else - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") -#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") -#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") -#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") -#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") #else - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") -#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") -#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") #else - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wcast-qual") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") -#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") #else - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL #endif -#if defined(NLOHMANN_JSON_HEDLEY_DEPRECATED) - #undef NLOHMANN_JSON_HEDLEY_DEPRECATED +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED #endif -#if defined(NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR) - #undef NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR #endif #if defined(__cplusplus) && (__cplusplus >= 201402L) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] + #define JSON_HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] #elif \ - NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,3,0) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) + JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,3,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) #elif \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) #elif \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ - NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) _declspec(deprecated) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define JSON_HEDLEY_DEPRECATED(since) _declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") #else - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNAVAILABLE) - #undef NLOHMANN_JSON_HEDLEY_UNAVAILABLE +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) #else - #define NLOHMANN_JSON_HEDLEY_UNAVAILABLE(available_since) + #define JSON_HEDLEY_UNAVAILABLE(available_since) #endif -#if defined(NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT) - #undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT #endif #if defined(__cplusplus) && (__cplusplus >= 201703L) - #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] + #define JSON_HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] #elif \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) #elif defined(_Check_return_) /* SAL */ - #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ #else - #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT #endif -#if defined(NLOHMANN_JSON_HEDLEY_SENTINEL) - #undef NLOHMANN_JSON_HEDLEY_SENTINEL +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) - #define NLOHMANN_JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) #else - #define NLOHMANN_JSON_HEDLEY_SENTINEL(position) + #define JSON_HEDLEY_SENTINEL(position) #endif -#if defined(NLOHMANN_JSON_HEDLEY_NO_RETURN) - #undef NLOHMANN_JSON_HEDLEY_NO_RETURN +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN #endif -#if NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __noreturn -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - #define NLOHMANN_JSON_HEDLEY_NO_RETURN _Noreturn + #define JSON_HEDLEY_NO_RETURN _Noreturn #elif defined(__cplusplus) && (__cplusplus >= 201103L) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN [[noreturn]] + #define JSON_HEDLEY_NO_RETURN [[noreturn]] #elif \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(18,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __declspec(noreturn) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") -#elif NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute((noreturn)) -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __declspec(noreturn) + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) #else - #define NLOHMANN_JSON_HEDLEY_NO_RETURN + #define JSON_HEDLEY_NO_RETURN #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE) - #undef NLOHMANN_JSON_HEDLEY_UNREACHABLE +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN) - #undef NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN #endif #if \ - (NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION))) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() __assume(0) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_UNREACHABLE() __assume(0) +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() std::_nassert(0) + #define JSON_HEDLEY_UNREACHABLE() std::_nassert(0) #else - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() _nassert(0) + #define JSON_HEDLEY_UNREACHABLE() _nassert(0) #endif - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) return value + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return value #elif defined(EXIT_FAILURE) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() abort() + #define JSON_HEDLEY_UNREACHABLE() abort() #else - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) return value + #define JSON_HEDLEY_UNREACHABLE() + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return value #endif -#if !defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) NLOHMANN_JSON_HEDLEY_UNREACHABLE() +#if !defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() #endif -#if defined(NLOHMANN_JSON_HEDLEY_ASSUME) - #undef NLOHMANN_JSON_HEDLEY_ASSUME +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME #endif #if \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) __assume(expr) -#elif NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) #else - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) #endif #elif \ - (NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION)) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(JSON_HEDLEY_ARM_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define JSON_HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) #else - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) ((void) (expr)) + #define JSON_HEDLEY_ASSUME(expr) ((void) (expr)) #endif -NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH +JSON_HEDLEY_DIAGNOSTIC_PUSH #if \ - NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) + JSON_HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) #if defined(__clang__) #pragma clang diagnostic ignored "-Wvariadic-macros" - #elif defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) + #elif defined(JSON_HEDLEY_GCC_VERSION) #pragma GCC diagnostic ignored "-Wvariadic-macros" #endif #endif -#if defined(NLOHMANN_JSON_HEDLEY_NON_NULL) - #undef NLOHMANN_JSON_HEDLEY_NON_NULL +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) - #define NLOHMANN_JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) #else - #define NLOHMANN_JSON_HEDLEY_NON_NULL(...) + #define JSON_HEDLEY_NON_NULL(...) #endif -NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +JSON_HEDLEY_DIAGNOSTIC_POP -#if defined(NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT) - #undef NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT #endif -#if defined(__MINGW32__) && NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) -#elif defined(__MINGW32__) && NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) #elif \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) #else - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CONSTEXPR) - #undef NLOHMANN_JSON_HEDLEY_CONSTEXPR +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR #endif #if defined(__cplusplus) #if __cplusplus >= 201103L - #define NLOHMANN_JSON_HEDLEY_CONSTEXPR constexpr + #define JSON_HEDLEY_CONSTEXPR constexpr #endif #endif -#if !defined(NLOHMANN_JSON_HEDLEY_CONSTEXPR) - #define NLOHMANN_JSON_HEDLEY_CONSTEXPR +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR #endif -#if defined(NLOHMANN_JSON_HEDLEY_PREDICT) - #undef NLOHMANN_JSON_HEDLEY_PREDICT +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT #endif -#if defined(NLOHMANN_JSON_HEDLEY_LIKELY) - #undef NLOHMANN_JSON_HEDLEY_LIKELY +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNLIKELY) - #undef NLOHMANN_JSON_HEDLEY_UNLIKELY +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNPREDICTABLE) - #undef NLOHMANN_JSON_HEDLEY_UNPREDICTABLE +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE #endif -#if NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) - #define NLOHMANN_JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) -# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) -# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) -# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) -# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) -#if !defined(NLOHMANN_JSON_HEDLEY_BUILTIN_UNPREDICTABLE) - #define NLOHMANN_JSON_HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#if !defined(JSON_HEDLEY_BUILTIN_UNPREDICTABLE) + #define JSON_HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) #endif #elif \ - NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ - NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) -# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, expected, probability) \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void) (expected)), !!(expr))) -# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ (__extension__ ({ \ - NLOHMANN_JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ })) -# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ (__extension__ ({ \ - NLOHMANN_JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ })) -# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) #else -# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) -# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) -# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) -# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) (!!(expr)) -# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) #endif -#if !defined(NLOHMANN_JSON_HEDLEY_UNPREDICTABLE) - #define NLOHMANN_JSON_HEDLEY_UNPREDICTABLE(expr) NLOHMANN_JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) #endif -#if defined(NLOHMANN_JSON_HEDLEY_MALLOC) - #undef NLOHMANN_JSON_HEDLEY_MALLOC +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_MALLOC __attribute__((__malloc__)) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) - #define NLOHMANN_JSON_HEDLEY_MALLOC __declspec(restrict) + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) #else - #define NLOHMANN_JSON_HEDLEY_MALLOC + #define JSON_HEDLEY_MALLOC #endif -#if defined(NLOHMANN_JSON_HEDLEY_PURE) - #undef NLOHMANN_JSON_HEDLEY_PURE +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_PURE __attribute__((__pure__)) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") #else - #define NLOHMANN_JSON_HEDLEY_PURE + #define JSON_HEDLEY_PURE #endif -#if defined(NLOHMANN_JSON_HEDLEY_CONST) - #undef NLOHMANN_JSON_HEDLEY_CONST +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_CONST __attribute__((__const__)) + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_CONST __attribute__((__const__)) #else - #define NLOHMANN_JSON_HEDLEY_CONST NLOHMANN_JSON_HEDLEY_PURE + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE #endif -#if defined(NLOHMANN_JSON_HEDLEY_RESTRICT) - #undef NLOHMANN_JSON_HEDLEY_RESTRICT +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT #endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_RESTRICT restrict + #define JSON_HEDLEY_RESTRICT restrict #elif \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ - NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ defined(__clang__) - #define NLOHMANN_JSON_HEDLEY_RESTRICT __restrict -#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_RESTRICT _Restrict + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict #else - #define NLOHMANN_JSON_HEDLEY_RESTRICT + #define JSON_HEDLEY_RESTRICT #endif -#if defined(NLOHMANN_JSON_HEDLEY_INLINE) - #undef NLOHMANN_JSON_HEDLEY_INLINE +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE #endif #if \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ (defined(__cplusplus) && (__cplusplus >= 199711L)) - #define NLOHMANN_JSON_HEDLEY_INLINE inline + #define JSON_HEDLEY_INLINE inline #elif \ - defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) - #define NLOHMANN_JSON_HEDLEY_INLINE __inline__ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ #elif \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_INLINE __inline + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_INLINE __inline #else - #define NLOHMANN_JSON_HEDLEY_INLINE + #define JSON_HEDLEY_INLINE #endif -#if defined(NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE) - #undef NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) NLOHMANN_JSON_HEDLEY_INLINE -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE __forceinline -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) + #define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif JSON_HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") #else - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE NLOHMANN_JSON_HEDLEY_INLINE + #define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE #endif -#if defined(NLOHMANN_JSON_HEDLEY_NEVER_INLINE) - #undef NLOHMANN_JSON_HEDLEY_NEVER_INLINE +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __declspec(noinline) -#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") -#elif NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __declspec(noinline) + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) #else - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE + #define JSON_HEDLEY_NEVER_INLINE #endif -#if defined(NLOHMANN_JSON_HEDLEY_PRIVATE) - #undef NLOHMANN_JSON_HEDLEY_PRIVATE +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE #endif -#if defined(NLOHMANN_JSON_HEDLEY_PUBLIC) - #undef NLOHMANN_JSON_HEDLEY_PUBLIC +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC #endif -#if defined(NLOHMANN_JSON_HEDLEY_IMPORT) - #undef NLOHMANN_JSON_HEDLEY_IMPORT +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT #endif #if defined(_WIN32) || defined(__CYGWIN__) - #define NLOHMANN_JSON_HEDLEY_PRIVATE - #define NLOHMANN_JSON_HEDLEY_PUBLIC __declspec(dllexport) - #define NLOHMANN_JSON_HEDLEY_IMPORT __declspec(dllimport) + #define JSON_HEDLEY_PRIVATE + #define JSON_HEDLEY_PUBLIC __declspec(dllexport) + #define JSON_HEDLEY_IMPORT __declspec(dllimport) #else #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) - #define NLOHMANN_JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) + #define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) #else - #define NLOHMANN_JSON_HEDLEY_PRIVATE - #define NLOHMANN_JSON_HEDLEY_PUBLIC + #define JSON_HEDLEY_PRIVATE + #define JSON_HEDLEY_PUBLIC #endif - #define NLOHMANN_JSON_HEDLEY_IMPORT extern + #define JSON_HEDLEY_IMPORT extern #endif -#if defined(NLOHMANN_JSON_HEDLEY_NO_THROW) - #undef NLOHMANN_JSON_HEDLEY_NO_THROW +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) #elif \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) - #define NLOHMANN_JSON_HEDLEY_NO_THROW __declspec(nothrow) + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) #else - #define NLOHMANN_JSON_HEDLEY_NO_THROW + #define JSON_HEDLEY_NO_THROW #endif -#if defined(NLOHMANN_JSON_HEDLEY_FALL_THROUGH) - #undef NLOHMANN_JSON_HEDLEY_FALL_THROUGH +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH #endif #if \ defined(__cplusplus) && \ - (!defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) || NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ - !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + !defined(JSON_HEDLEY_PGI_VERSION) #if \ (__cplusplus >= 201703L) || \ - ((__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[fallthrough]] - #elif (__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[clang::fallthrough]] - #elif (__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[gnu::fallthrough]] + ((__cplusplus >= 201103L) && JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) + #define JSON_HEDLEY_FALL_THROUGH [[fallthrough]] + #elif (__cplusplus >= 201103L) && JSON_HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) + #define JSON_HEDLEY_FALL_THROUGH [[clang::fallthrough]] + #elif (__cplusplus >= 201103L) && JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define JSON_HEDLEY_FALL_THROUGH [[gnu::fallthrough]] #endif #endif -#if !defined(NLOHMANN_JSON_HEDLEY_FALL_THROUGH) - #if NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#if !defined(JSON_HEDLEY_FALL_THROUGH) + #if JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) #elif defined(__fallthrough) /* SAL */ - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH __fallthrough + #define JSON_HEDLEY_FALL_THROUGH __fallthrough #else - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH + #define JSON_HEDLEY_FALL_THROUGH #endif #endif -#if defined(NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL) - #undef NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) - #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) #elif defined(_Ret_notnull_) /* SAL */ - #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ #else - #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + #define JSON_HEDLEY_RETURNS_NON_NULL #endif -#if defined(NLOHMANN_JSON_HEDLEY_ARRAY_PARAM) - #undef NLOHMANN_JSON_HEDLEY_ARRAY_PARAM +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM #endif #if \ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ !defined(__STDC_NO_VLA__) && \ !defined(__cplusplus) && \ - !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) && \ - !defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) - #define NLOHMANN_JSON_HEDLEY_ARRAY_PARAM(name) (name) + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) #else - #define NLOHMANN_JSON_HEDLEY_ARRAY_PARAM(name) + #define JSON_HEDLEY_ARRAY_PARAM(name) #endif -#if defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) - #undef NLOHMANN_JSON_HEDLEY_IS_CONSTANT +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT #endif -#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR) - #undef NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR #endif /* Note the double-underscore. For internal use only; no API * guarantees! */ -#if defined(NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR) - #undef NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR +#if defined(JSON_HEDLEY__IS_CONSTEXPR) + #undef JSON_HEDLEY__IS_CONSTEXPR #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ - NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) - #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) #endif #if !defined(__cplusplus) # if \ - NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ - NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) #if defined(__INTPTR_TYPE__) - #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) + #define JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) #else #include - #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) + #define JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) #endif # elif \ - (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) && !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION)) || \ - NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(JSON_HEDLEY_SUNPRO_VERSION) && !defined(JSON_HEDLEY_PGI_VERSION)) || \ + JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) #if defined(__INTPTR_TYPE__) - #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) + #define JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) #else #include - #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) + #define JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) #endif # elif \ - defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) || \ - defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) || \ - defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) || \ - defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) || \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_VERSION) || \ defined(__clang__) -# define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) ( \ +# define JSON_HEDLEY__IS_CONSTEXPR(expr) ( \ sizeof(void) != \ sizeof(*( \ 1 ? \ @@ -1268,238 +1268,238 @@ NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP ((struct { char v[sizeof(void) * 2]; } *) 1) \ ) \ ) \ - ) + ) # endif #endif -#if defined(NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR) - #if !defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) - #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) +#if defined(JSON_HEDLEY__IS_CONSTEXPR) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY__IS_CONSTEXPR(expr) #endif - #define NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) #else - #if !defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) - #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) (0) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) #endif - #define NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) #endif -#if defined(NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS) - #undef NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS #endif -#if defined(NLOHMANN_JSON_HEDLEY_END_C_DECLS) - #undef NLOHMANN_JSON_HEDLEY_END_C_DECLS +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS #endif -#if defined(NLOHMANN_JSON_HEDLEY_C_DECL) - #undef NLOHMANN_JSON_HEDLEY_C_DECL +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL #endif #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS extern "C" { - #define NLOHMANN_JSON_HEDLEY_END_C_DECLS } - #define NLOHMANN_JSON_HEDLEY_C_DECL extern "C" + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" #else - #define NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS - #define NLOHMANN_JSON_HEDLEY_END_C_DECLS - #define NLOHMANN_JSON_HEDLEY_C_DECL + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL #endif -#if defined(NLOHMANN_JSON_HEDLEY_STATIC_ASSERT) - #undef NLOHMANN_JSON_HEDLEY_STATIC_ASSERT +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT #endif #if \ !defined(__cplusplus) && ( \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ - NLOHMANN_JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ defined(_Static_assert) \ ) -# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) #elif \ (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ - (defined(__cplusplus) && NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,3,0)) -# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + (defined(__cplusplus) && JSON_HEDLEY_TI_VERSION_CHECK(8,3,0)) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) #elif defined(__cplusplus) && (__cplusplus >= 201103L) -# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) #else -# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CONST_CAST) - #undef NLOHMANN_JSON_HEDLEY_CONST_CAST +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST #endif #if defined(__cplusplus) -# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) #elif \ - NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) -# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ ((T) (expr)); \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP \ + JSON_HEDLEY_DIAGNOSTIC_POP \ })) #else -# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) #endif -#if defined(NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST) - #undef NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST #endif #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) #else - #define NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) #endif -#if defined(NLOHMANN_JSON_HEDLEY_STATIC_CAST) - #undef NLOHMANN_JSON_HEDLEY_STATIC_CAST +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST #endif #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) #else - #define NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CPP_CAST) - #undef NLOHMANN_JSON_HEDLEY_CPP_CAST +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST #endif #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_CPP_CAST(T, expr) static_cast(expr) + #define JSON_HEDLEY_CPP_CAST(T, expr) static_cast(expr) #else - #define NLOHMANN_JSON_HEDLEY_CPP_CAST(T, expr) (expr) + #define JSON_HEDLEY_CPP_CAST(T, expr) (expr) #endif -#if defined(NLOHMANN_JSON_HEDLEY_MESSAGE) - #undef NLOHMANN_JSON_HEDLEY_MESSAGE +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - NLOHMANN_JSON_HEDLEY_PRAGMA(message msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP #elif \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message msg) -#elif NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(_CRI message msg) -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) #else -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) +# define JSON_HEDLEY_MESSAGE(msg) #endif -#if defined(NLOHMANN_JSON_HEDLEY_WARNING) - #undef NLOHMANN_JSON_HEDLEY_WARNING +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") -# define NLOHMANN_JSON_HEDLEY_WARNING(msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - NLOHMANN_JSON_HEDLEY_PRAGMA(clang warning msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP #elif \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) -# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(GCC warning msg) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) -# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) #else -# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_MESSAGE(msg) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) #endif -#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE_MSG) - #undef NLOHMANN_JSON_HEDLEY_REQUIRE_MSG +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG #endif -#if NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) -# if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") -# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE_MSG(expr, msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ __attribute__((__diagnose_if__(!(expr), msg, "error"))) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP + JSON_HEDLEY_DIAGNOSTIC_POP # else -# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) # endif #else -# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) +# define JSON_HEDLEY_REQUIRE_MSG(expr, msg) #endif -#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE) - #undef NLOHMANN_JSON_HEDLEY_REQUIRE +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE #endif -#define NLOHMANN_JSON_HEDLEY_REQUIRE(expr) NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, #expr) +#define JSON_HEDLEY_REQUIRE(expr) JSON_HEDLEY_REQUIRE_MSG(expr, #expr) -#if defined(NLOHMANN_JSON_HEDLEY_FLAGS) - #undef NLOHMANN_JSON_HEDLEY_FLAGS +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS #endif -#if NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) - #define NLOHMANN_JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) #endif -#if defined(NLOHMANN_JSON_HEDLEY_FLAGS_CAST) - #undef NLOHMANN_JSON_HEDLEY_FLAGS_CAST +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST #endif -#if NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) -# define NLOHMANN_JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("warning(disable:188)") \ ((T) (expr)); \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP \ + JSON_HEDLEY_DIAGNOSTIC_POP \ })) #else -# define NLOHMANN_JSON_HEDLEY_FLAGS_CAST(T, expr) NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) #endif /* Remaining macros are deprecated. */ -#if defined(NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK #endif #if defined(__clang__) - #define NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) #else - #define NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE(feature) NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING(warning) NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) -#endif /* !defined(NLOHMANN_JSON_HEDLEY_VERSION) || (NLOHMANN_JSON_HEDLEY_VERSION < X) */ +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ diff --git a/include/nlohmann/thirdparty/hedley/hedley_undef.hpp b/include/nlohmann/thirdparty/hedley/hedley_undef.hpp index 5e95ae5a..9e8f6d48 100644 --- a/include/nlohmann/thirdparty/hedley/hedley_undef.hpp +++ b/include/nlohmann/thirdparty/hedley/hedley_undef.hpp @@ -1,121 +1,121 @@ -#undef NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE -#undef NLOHMANN_JSON_HEDLEY_ARM_VERSION -#undef NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_ARRAY_PARAM -#undef NLOHMANN_JSON_HEDLEY_ASSUME -#undef NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING -#undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION -#undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_CONCAT -#undef NLOHMANN_JSON_HEDLEY_CONCAT_EX -#undef NLOHMANN_JSON_HEDLEY_CONST -#undef NLOHMANN_JSON_HEDLEY_CONSTEXPR -#undef NLOHMANN_JSON_HEDLEY_CONST_CAST -#undef NLOHMANN_JSON_HEDLEY_CPP_CAST -#undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION -#undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_C_DECL -#undef NLOHMANN_JSON_HEDLEY_DEPRECATED -#undef NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH -#undef NLOHMANN_JSON_HEDLEY_DMC_VERSION -#undef NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION -#undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_END_C_DECLS -#undef NLOHMANN_JSON_HEDLEY_FALL_THROUGH -#undef NLOHMANN_JSON_HEDLEY_FLAGS -#undef NLOHMANN_JSON_HEDLEY_FLAGS_CAST -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING -#undef NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_GCC_VERSION -#undef NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING -#undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION -#undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_HAS_BUILTIN -#undef NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_HAS_EXTENSION -#undef NLOHMANN_JSON_HEDLEY_HAS_FEATURE -#undef NLOHMANN_JSON_HEDLEY_HAS_WARNING -#undef NLOHMANN_JSON_HEDLEY_IAR_VERSION -#undef NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_IBM_VERSION -#undef NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_IMPORT -#undef NLOHMANN_JSON_HEDLEY_INLINE -#undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION -#undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_IS_CONSTANT -#undef NLOHMANN_JSON_HEDLEY_LIKELY -#undef NLOHMANN_JSON_HEDLEY_MALLOC -#undef NLOHMANN_JSON_HEDLEY_MESSAGE -#undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION -#undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_NEVER_INLINE -#undef NLOHMANN_JSON_HEDLEY_NON_NULL -#undef NLOHMANN_JSON_HEDLEY_NO_RETURN -#undef NLOHMANN_JSON_HEDLEY_NO_THROW -#undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION -#undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_PGI_VERSION -#undef NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_PREDICT -#undef NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT -#undef NLOHMANN_JSON_HEDLEY_PRIVATE -#undef NLOHMANN_JSON_HEDLEY_PUBLIC -#undef NLOHMANN_JSON_HEDLEY_PURE -#undef NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST -#undef NLOHMANN_JSON_HEDLEY_REQUIRE -#undef NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR -#undef NLOHMANN_JSON_HEDLEY_REQUIRE_MSG -#undef NLOHMANN_JSON_HEDLEY_RESTRICT -#undef NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL -#undef NLOHMANN_JSON_HEDLEY_SENTINEL -#undef NLOHMANN_JSON_HEDLEY_STATIC_ASSERT -#undef NLOHMANN_JSON_HEDLEY_STATIC_CAST -#undef NLOHMANN_JSON_HEDLEY_STRINGIFY -#undef NLOHMANN_JSON_HEDLEY_STRINGIFY_EX -#undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION -#undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION -#undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_TI_VERSION -#undef NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_UNAVAILABLE -#undef NLOHMANN_JSON_HEDLEY_UNLIKELY -#undef NLOHMANN_JSON_HEDLEY_UNPREDICTABLE -#undef NLOHMANN_JSON_HEDLEY_UNREACHABLE -#undef NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN -#undef NLOHMANN_JSON_HEDLEY_VERSION -#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR -#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR -#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION -#undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE -#undef NLOHMANN_JSON_HEDLEY_WARNING -#undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT +#undef JSON_HEDLEY_ALWAYS_INLINE +#undef JSON_HEDLEY_ARM_VERSION +#undef JSON_HEDLEY_ARM_VERSION_CHECK +#undef JSON_HEDLEY_ARRAY_PARAM +#undef JSON_HEDLEY_ASSUME +#undef JSON_HEDLEY_BEGIN_C_DECLS +#undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#undef JSON_HEDLEY_CLANG_HAS_FEATURE +#undef JSON_HEDLEY_CLANG_HAS_WARNING +#undef JSON_HEDLEY_COMPCERT_VERSION +#undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#undef JSON_HEDLEY_CONCAT +#undef JSON_HEDLEY_CONCAT_EX +#undef JSON_HEDLEY_CONST +#undef JSON_HEDLEY_CONSTEXPR +#undef JSON_HEDLEY_CONST_CAST +#undef JSON_HEDLEY_CPP_CAST +#undef JSON_HEDLEY_CRAY_VERSION +#undef JSON_HEDLEY_CRAY_VERSION_CHECK +#undef JSON_HEDLEY_C_DECL +#undef JSON_HEDLEY_DEPRECATED +#undef JSON_HEDLEY_DEPRECATED_FOR +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#undef JSON_HEDLEY_DIAGNOSTIC_POP +#undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#undef JSON_HEDLEY_DMC_VERSION +#undef JSON_HEDLEY_DMC_VERSION_CHECK +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#undef JSON_HEDLEY_END_C_DECLS +#undef JSON_HEDLEY_FALL_THROUGH +#undef JSON_HEDLEY_FLAGS +#undef JSON_HEDLEY_FLAGS_CAST +#undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_BUILTIN +#undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_EXTENSION +#undef JSON_HEDLEY_GCC_HAS_FEATURE +#undef JSON_HEDLEY_GCC_HAS_WARNING +#undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#undef JSON_HEDLEY_GCC_VERSION +#undef JSON_HEDLEY_GCC_VERSION_CHECK +#undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#undef JSON_HEDLEY_GNUC_HAS_FEATURE +#undef JSON_HEDLEY_GNUC_HAS_WARNING +#undef JSON_HEDLEY_GNUC_VERSION +#undef JSON_HEDLEY_GNUC_VERSION_CHECK +#undef JSON_HEDLEY_HAS_ATTRIBUTE +#undef JSON_HEDLEY_HAS_BUILTIN +#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_HAS_EXTENSION +#undef JSON_HEDLEY_HAS_FEATURE +#undef JSON_HEDLEY_HAS_WARNING +#undef JSON_HEDLEY_IAR_VERSION +#undef JSON_HEDLEY_IAR_VERSION_CHECK +#undef JSON_HEDLEY_IBM_VERSION +#undef JSON_HEDLEY_IBM_VERSION_CHECK +#undef JSON_HEDLEY_IMPORT +#undef JSON_HEDLEY_INLINE +#undef JSON_HEDLEY_INTEL_VERSION +#undef JSON_HEDLEY_INTEL_VERSION_CHECK +#undef JSON_HEDLEY_IS_CONSTANT +#undef JSON_HEDLEY_LIKELY +#undef JSON_HEDLEY_MALLOC +#undef JSON_HEDLEY_MESSAGE +#undef JSON_HEDLEY_MSVC_VERSION +#undef JSON_HEDLEY_MSVC_VERSION_CHECK +#undef JSON_HEDLEY_NEVER_INLINE +#undef JSON_HEDLEY_NON_NULL +#undef JSON_HEDLEY_NO_RETURN +#undef JSON_HEDLEY_NO_THROW +#undef JSON_HEDLEY_PELLES_VERSION +#undef JSON_HEDLEY_PELLES_VERSION_CHECK +#undef JSON_HEDLEY_PGI_VERSION +#undef JSON_HEDLEY_PGI_VERSION_CHECK +#undef JSON_HEDLEY_PREDICT +#undef JSON_HEDLEY_PRINTF_FORMAT +#undef JSON_HEDLEY_PRIVATE +#undef JSON_HEDLEY_PUBLIC +#undef JSON_HEDLEY_PURE +#undef JSON_HEDLEY_REINTERPRET_CAST +#undef JSON_HEDLEY_REQUIRE +#undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#undef JSON_HEDLEY_REQUIRE_MSG +#undef JSON_HEDLEY_RESTRICT +#undef JSON_HEDLEY_RETURNS_NON_NULL +#undef JSON_HEDLEY_SENTINEL +#undef JSON_HEDLEY_STATIC_ASSERT +#undef JSON_HEDLEY_STATIC_CAST +#undef JSON_HEDLEY_STRINGIFY +#undef JSON_HEDLEY_STRINGIFY_EX +#undef JSON_HEDLEY_SUNPRO_VERSION +#undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#undef JSON_HEDLEY_TINYC_VERSION +#undef JSON_HEDLEY_TINYC_VERSION_CHECK +#undef JSON_HEDLEY_TI_VERSION +#undef JSON_HEDLEY_TI_VERSION_CHECK +#undef JSON_HEDLEY_UNAVAILABLE +#undef JSON_HEDLEY_UNLIKELY +#undef JSON_HEDLEY_UNPREDICTABLE +#undef JSON_HEDLEY_UNREACHABLE +#undef JSON_HEDLEY_UNREACHABLE_RETURN +#undef JSON_HEDLEY_VERSION +#undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#undef JSON_HEDLEY_VERSION_DECODE_MINOR +#undef JSON_HEDLEY_VERSION_DECODE_REVISION +#undef JSON_HEDLEY_VERSION_ENCODE +#undef JSON_HEDLEY_WARNING +#undef JSON_HEDLEY_WARN_UNUSED_RESULT diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 6778fd41..e2704b9f 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -122,1257 +122,1257 @@ struct position_t * SPDX-License-Identifier: CC0-1.0 */ -#if !defined(NLOHMANN_JSON_HEDLEY_VERSION) || (NLOHMANN_JSON_HEDLEY_VERSION < 9) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION) - #undef NLOHMANN_JSON_HEDLEY_VERSION +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 9) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION #endif -#define NLOHMANN_JSON_HEDLEY_VERSION 9 +#define JSON_HEDLEY_VERSION 9 -#if defined(NLOHMANN_JSON_HEDLEY_STRINGIFY_EX) - #undef NLOHMANN_JSON_HEDLEY_STRINGIFY_EX +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX #endif -#define NLOHMANN_JSON_HEDLEY_STRINGIFY_EX(x) #x +#define JSON_HEDLEY_STRINGIFY_EX(x) #x -#if defined(NLOHMANN_JSON_HEDLEY_STRINGIFY) - #undef NLOHMANN_JSON_HEDLEY_STRINGIFY +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY #endif -#define NLOHMANN_JSON_HEDLEY_STRINGIFY(x) NLOHMANN_JSON_HEDLEY_STRINGIFY_EX(x) +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) -#if defined(NLOHMANN_JSON_HEDLEY_CONCAT_EX) - #undef NLOHMANN_JSON_HEDLEY_CONCAT_EX +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX #endif -#define NLOHMANN_JSON_HEDLEY_CONCAT_EX(a,b) a##b +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b -#if defined(NLOHMANN_JSON_HEDLEY_CONCAT) - #undef NLOHMANN_JSON_HEDLEY_CONCAT +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT #endif -#define NLOHMANN_JSON_HEDLEY_CONCAT(a,b) NLOHMANN_JSON_HEDLEY_CONCAT_EX(a,b) +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION_ENCODE) - #undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE #endif -#define NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR) - #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR #endif -#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR) - #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR #endif -#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) -#if defined(NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION) - #undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION #endif -#define NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION #endif #if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) - #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) #elif defined(__GNUC__) - #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) - #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_GNUC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_MSVC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION #endif #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) #elif defined(_MSC_FULL_VER) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) #elif defined(_MSC_VER) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK #endif #if !defined(_MSC_VER) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) #elif defined(_MSC_VER) && (_MSC_VER >= 1400) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) #elif defined(_MSC_VER) && (_MSC_VER >= 1200) - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) #else - #define NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) #endif -#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) - #undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION #endif #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) - #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) #elif defined(__INTEL_COMPILER) - #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) - #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_INTEL_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) - #undef NLOHMANN_JSON_HEDLEY_PGI_VERSION +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION #endif #if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) - #define NLOHMANN_JSON_HEDLEY_PGI_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) #endif -#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) - #define NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_PGI_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) - #undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION #endif #if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) #elif defined(__SUNPRO_C) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) #elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) #elif defined(__SUNPRO_CC) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) #endif -#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION) - #undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION #endif #if defined(__EMSCRIPTEN__) - #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) #endif -#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION) - #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) - #undef NLOHMANN_JSON_HEDLEY_ARM_VERSION +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION #endif #if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) - #define NLOHMANN_JSON_HEDLEY_ARM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) #elif defined(__CC_ARM) && defined(__ARMCC_VERSION) - #define NLOHMANN_JSON_HEDLEY_ARM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) #endif -#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) - #define NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_ARM_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION) - #undef NLOHMANN_JSON_HEDLEY_IBM_VERSION +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION #endif #if defined(__ibmxl__) - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) #elif defined(__xlC__) && defined(__xlC_ver__) - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) #elif defined(__xlC__) - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_IBM_VERSION) - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_IBM_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) - #undef NLOHMANN_JSON_HEDLEY_TI_VERSION +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION #endif #if defined(__TI_COMPILER_VERSION__) - #define NLOHMANN_JSON_HEDLEY_TI_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) #endif -#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) - #define NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_TI_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION) - #undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION #endif #if defined(_CRAYC) #if defined(_RELEASE_PATCHLEVEL) - #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) #else - #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) #endif #endif -#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_CRAY_VERSION) - #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_CRAY_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION) - #undef NLOHMANN_JSON_HEDLEY_IAR_VERSION +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION #endif #if defined(__IAR_SYSTEMS_ICC__) #if __VER__ > 1000 - #define NLOHMANN_JSON_HEDLEY_IAR_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) #else - #define NLOHMANN_JSON_HEDLEY_IAR_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) #endif #endif -#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_IAR_VERSION) - #define NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_IAR_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION #endif #if defined(__TINYC__) - #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) #endif -#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) - #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_TINYC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_DMC_VERSION +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION #endif #if defined(__DMC__) - #define NLOHMANN_JSON_HEDLEY_DMC_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) #endif -#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_DMC_VERSION) - #define NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_DMC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION) - #undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION #endif #if defined(__COMPCERT_VERSION__) - #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) #endif -#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION) - #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION) - #undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION #endif #if defined(__POCC__) - #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_PELLES_VERSION) - #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_PELLES_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) - #undef NLOHMANN_JSON_HEDLEY_GCC_VERSION +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION #endif #if \ - defined(NLOHMANN_JSON_HEDLEY_GNUC_VERSION) && \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ !defined(__clang__) && \ - !defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) && \ - !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) && \ - !defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION) && \ - !defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ !defined(__COMPCERT__) - #define NLOHMANN_JSON_HEDLEY_GCC_VERSION NLOHMANN_JSON_HEDLEY_GNUC_VERSION + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) - #define NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (NLOHMANN_JSON_HEDLEY_GCC_VERSION >= NLOHMANN_JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE #endif #if defined(__has_attribute) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE #endif #if defined(__has_cpp_attribute) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_BUILTIN) - #undef NLOHMANN_JSON_HEDLEY_HAS_BUILTIN +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN #endif #if defined(__has_builtin) - #define NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) #else - #define NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) (0) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN #endif #if defined(__has_builtin) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN #endif #if defined(__has_builtin) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_FEATURE) - #undef NLOHMANN_JSON_HEDLEY_HAS_FEATURE +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE #endif #if defined(__has_feature) - #define NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) #else - #define NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) (0) + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE #endif #if defined(__has_feature) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE #endif #if defined(__has_feature) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_EXTENSION) - #undef NLOHMANN_JSON_HEDLEY_HAS_EXTENSION +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION #endif #if defined(__has_extension) - #define NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) #else - #define NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) (0) + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION #endif #if defined(__has_extension) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION #endif #if defined(__has_extension) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE #endif #if defined(__has_declspec_attribute) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_HAS_WARNING) - #undef NLOHMANN_JSON_HEDLEY_HAS_WARNING +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING #endif #if defined(__has_warning) - #define NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) #else - #define NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) (0) + #define JSON_HEDLEY_HAS_WARNING(warning) (0) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING) - #undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING #endif #if defined(__has_warning) - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) #else - #define NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING) - #undef NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING #endif #if defined(__has_warning) - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) #else - #define NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif #if \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ defined(__clang__) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) || \ - NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ - NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) - #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) _Pragma(#value) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) __pragma(value) + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) #else - #define NLOHMANN_JSON_HEDLEY_PRAGMA(value) + #define JSON_HEDLEY_PRAGMA(value) #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP #endif #if defined(__clang__) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") -#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) -#elif NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,1,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif JSON_HEDLEY_TI_VERSION_CHECK(8,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") #else - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") -#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") -#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") -#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") -#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") #else - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") -#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") -#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") #else - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS #endif -#if defined(NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) - #undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wcast-qual") - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") -#elif NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") #else - #define NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL #endif -#if defined(NLOHMANN_JSON_HEDLEY_DEPRECATED) - #undef NLOHMANN_JSON_HEDLEY_DEPRECATED +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED #endif -#if defined(NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR) - #undef NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR #endif #if defined(__cplusplus) && (__cplusplus >= 201402L) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] + #define JSON_HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] #elif \ - NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,3,0) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) + JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,3,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) #elif \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) #elif \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ - NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) _declspec(deprecated) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define JSON_HEDLEY_DEPRECATED(since) _declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") #else - #define NLOHMANN_JSON_HEDLEY_DEPRECATED(since) - #define NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR(since, replacement) + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNAVAILABLE) - #undef NLOHMANN_JSON_HEDLEY_UNAVAILABLE +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) #else - #define NLOHMANN_JSON_HEDLEY_UNAVAILABLE(available_since) + #define JSON_HEDLEY_UNAVAILABLE(available_since) #endif -#if defined(NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT) - #undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT #endif #if defined(__cplusplus) && (__cplusplus >= 201703L) - #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] + #define JSON_HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] #elif \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) #elif defined(_Check_return_) /* SAL */ - #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ #else - #define NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT #endif -#if defined(NLOHMANN_JSON_HEDLEY_SENTINEL) - #undef NLOHMANN_JSON_HEDLEY_SENTINEL +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) - #define NLOHMANN_JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) #else - #define NLOHMANN_JSON_HEDLEY_SENTINEL(position) + #define JSON_HEDLEY_SENTINEL(position) #endif -#if defined(NLOHMANN_JSON_HEDLEY_NO_RETURN) - #undef NLOHMANN_JSON_HEDLEY_NO_RETURN +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN #endif -#if NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __noreturn -#elif NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - #define NLOHMANN_JSON_HEDLEY_NO_RETURN _Noreturn + #define JSON_HEDLEY_NO_RETURN _Noreturn #elif defined(__cplusplus) && (__cplusplus >= 201103L) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN [[noreturn]] + #define JSON_HEDLEY_NO_RETURN [[noreturn]] #elif \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(18,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __declspec(noreturn) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") -#elif NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __attribute((noreturn)) -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) - #define NLOHMANN_JSON_HEDLEY_NO_RETURN __declspec(noreturn) + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) #else - #define NLOHMANN_JSON_HEDLEY_NO_RETURN + #define JSON_HEDLEY_NO_RETURN #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE) - #undef NLOHMANN_JSON_HEDLEY_UNREACHABLE +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN) - #undef NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN #endif #if \ - (NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION))) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() __assume(0) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_UNREACHABLE() __assume(0) +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() std::_nassert(0) + #define JSON_HEDLEY_UNREACHABLE() std::_nassert(0) #else - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() _nassert(0) + #define JSON_HEDLEY_UNREACHABLE() _nassert(0) #endif - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) return value + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return value #elif defined(EXIT_FAILURE) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() abort() + #define JSON_HEDLEY_UNREACHABLE() abort() #else - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE() - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) return value + #define JSON_HEDLEY_UNREACHABLE() + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return value #endif -#if !defined(NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN) - #define NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN(value) NLOHMANN_JSON_HEDLEY_UNREACHABLE() +#if !defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() #endif -#if defined(NLOHMANN_JSON_HEDLEY_ASSUME) - #undef NLOHMANN_JSON_HEDLEY_ASSUME +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME #endif #if \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) __assume(expr) -#elif NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) #else - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) #endif #elif \ - (NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(NLOHMANN_JSON_HEDLEY_ARM_VERSION)) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(JSON_HEDLEY_ARM_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define JSON_HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1))) #else - #define NLOHMANN_JSON_HEDLEY_ASSUME(expr) ((void) (expr)) + #define JSON_HEDLEY_ASSUME(expr) ((void) (expr)) #endif -NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH +JSON_HEDLEY_DIAGNOSTIC_PUSH #if \ - NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) + JSON_HEDLEY_HAS_WARNING("-Wvariadic-macros") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) #if defined(__clang__) #pragma clang diagnostic ignored "-Wvariadic-macros" - #elif defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) + #elif defined(JSON_HEDLEY_GCC_VERSION) #pragma GCC diagnostic ignored "-Wvariadic-macros" #endif #endif -#if defined(NLOHMANN_JSON_HEDLEY_NON_NULL) - #undef NLOHMANN_JSON_HEDLEY_NON_NULL +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) - #define NLOHMANN_JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) #else - #define NLOHMANN_JSON_HEDLEY_NON_NULL(...) + #define JSON_HEDLEY_NON_NULL(...) #endif -NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +JSON_HEDLEY_DIAGNOSTIC_POP -#if defined(NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT) - #undef NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT #endif -#if defined(__MINGW32__) && NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) -#elif defined(__MINGW32__) && NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) #elif \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) #else - #define NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CONSTEXPR) - #undef NLOHMANN_JSON_HEDLEY_CONSTEXPR +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR #endif #if defined(__cplusplus) #if __cplusplus >= 201103L - #define NLOHMANN_JSON_HEDLEY_CONSTEXPR constexpr + #define JSON_HEDLEY_CONSTEXPR constexpr #endif #endif -#if !defined(NLOHMANN_JSON_HEDLEY_CONSTEXPR) - #define NLOHMANN_JSON_HEDLEY_CONSTEXPR +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR #endif -#if defined(NLOHMANN_JSON_HEDLEY_PREDICT) - #undef NLOHMANN_JSON_HEDLEY_PREDICT +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT #endif -#if defined(NLOHMANN_JSON_HEDLEY_LIKELY) - #undef NLOHMANN_JSON_HEDLEY_LIKELY +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNLIKELY) - #undef NLOHMANN_JSON_HEDLEY_UNLIKELY +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY #endif -#if defined(NLOHMANN_JSON_HEDLEY_UNPREDICTABLE) - #undef NLOHMANN_JSON_HEDLEY_UNPREDICTABLE +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE #endif -#if NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) - #define NLOHMANN_JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) -# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) -# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) -# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) -# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) -#if !defined(NLOHMANN_JSON_HEDLEY_BUILTIN_UNPREDICTABLE) - #define NLOHMANN_JSON_HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#if !defined(JSON_HEDLEY_BUILTIN_UNPREDICTABLE) + #define JSON_HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) #endif #elif \ - NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ - NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) -# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, expected, probability) \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void) (expected)), !!(expr))) -# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ (__extension__ ({ \ - NLOHMANN_JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ })) -# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ (__extension__ ({ \ - NLOHMANN_JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ + JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ })) -# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) #else -# define NLOHMANN_JSON_HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) -# define NLOHMANN_JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) -# define NLOHMANN_JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) -# define NLOHMANN_JSON_HEDLEY_LIKELY(expr) (!!(expr)) -# define NLOHMANN_JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) #endif -#if !defined(NLOHMANN_JSON_HEDLEY_UNPREDICTABLE) - #define NLOHMANN_JSON_HEDLEY_UNPREDICTABLE(expr) NLOHMANN_JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) #endif -#if defined(NLOHMANN_JSON_HEDLEY_MALLOC) - #undef NLOHMANN_JSON_HEDLEY_MALLOC +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_MALLOC __attribute__((__malloc__)) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) - #define NLOHMANN_JSON_HEDLEY_MALLOC __declspec(restrict) + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) #else - #define NLOHMANN_JSON_HEDLEY_MALLOC + #define JSON_HEDLEY_MALLOC #endif -#if defined(NLOHMANN_JSON_HEDLEY_PURE) - #undef NLOHMANN_JSON_HEDLEY_PURE +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_PURE __attribute__((__pure__)) -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") #else - #define NLOHMANN_JSON_HEDLEY_PURE + #define JSON_HEDLEY_PURE #endif -#if defined(NLOHMANN_JSON_HEDLEY_CONST) - #undef NLOHMANN_JSON_HEDLEY_CONST +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) - #define NLOHMANN_JSON_HEDLEY_CONST __attribute__((__const__)) + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_CONST __attribute__((__const__)) #else - #define NLOHMANN_JSON_HEDLEY_CONST NLOHMANN_JSON_HEDLEY_PURE + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE #endif -#if defined(NLOHMANN_JSON_HEDLEY_RESTRICT) - #undef NLOHMANN_JSON_HEDLEY_RESTRICT +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT #endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_RESTRICT restrict + #define JSON_HEDLEY_RESTRICT restrict #elif \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ - NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ defined(__clang__) - #define NLOHMANN_JSON_HEDLEY_RESTRICT __restrict -#elif NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_RESTRICT _Restrict + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict #else - #define NLOHMANN_JSON_HEDLEY_RESTRICT + #define JSON_HEDLEY_RESTRICT #endif -#if defined(NLOHMANN_JSON_HEDLEY_INLINE) - #undef NLOHMANN_JSON_HEDLEY_INLINE +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE #endif #if \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ (defined(__cplusplus) && (__cplusplus >= 199711L)) - #define NLOHMANN_JSON_HEDLEY_INLINE inline + #define JSON_HEDLEY_INLINE inline #elif \ - defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) - #define NLOHMANN_JSON_HEDLEY_INLINE __inline__ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ #elif \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_INLINE __inline + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_INLINE __inline #else - #define NLOHMANN_JSON_HEDLEY_INLINE + #define JSON_HEDLEY_INLINE #endif -#if defined(NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE) - #undef NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) NLOHMANN_JSON_HEDLEY_INLINE -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE __forceinline -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) + #define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif JSON_HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") #else - #define NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE NLOHMANN_JSON_HEDLEY_INLINE + #define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE #endif -#if defined(NLOHMANN_JSON_HEDLEY_NEVER_INLINE) - #undef NLOHMANN_JSON_HEDLEY_NEVER_INLINE +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __declspec(noinline) -#elif NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") -#elif NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") -#elif NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE __declspec(noinline) + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) #else - #define NLOHMANN_JSON_HEDLEY_NEVER_INLINE + #define JSON_HEDLEY_NEVER_INLINE #endif -#if defined(NLOHMANN_JSON_HEDLEY_PRIVATE) - #undef NLOHMANN_JSON_HEDLEY_PRIVATE +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE #endif -#if defined(NLOHMANN_JSON_HEDLEY_PUBLIC) - #undef NLOHMANN_JSON_HEDLEY_PUBLIC +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC #endif -#if defined(NLOHMANN_JSON_HEDLEY_IMPORT) - #undef NLOHMANN_JSON_HEDLEY_IMPORT +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT #endif #if defined(_WIN32) || defined(__CYGWIN__) - #define NLOHMANN_JSON_HEDLEY_PRIVATE - #define NLOHMANN_JSON_HEDLEY_PUBLIC __declspec(dllexport) - #define NLOHMANN_JSON_HEDLEY_IMPORT __declspec(dllimport) + #define JSON_HEDLEY_PRIVATE + #define JSON_HEDLEY_PUBLIC __declspec(dllexport) + #define JSON_HEDLEY_IMPORT __declspec(dllimport) #else #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ - (NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) - #define NLOHMANN_JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) - #define NLOHMANN_JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) + #define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) + #define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) #else - #define NLOHMANN_JSON_HEDLEY_PRIVATE - #define NLOHMANN_JSON_HEDLEY_PUBLIC + #define JSON_HEDLEY_PRIVATE + #define JSON_HEDLEY_PUBLIC #endif - #define NLOHMANN_JSON_HEDLEY_IMPORT extern + #define JSON_HEDLEY_IMPORT extern #endif -#if defined(NLOHMANN_JSON_HEDLEY_NO_THROW) - #undef NLOHMANN_JSON_HEDLEY_NO_THROW +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) - #define NLOHMANN_JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) #elif \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) - #define NLOHMANN_JSON_HEDLEY_NO_THROW __declspec(nothrow) + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) #else - #define NLOHMANN_JSON_HEDLEY_NO_THROW + #define JSON_HEDLEY_NO_THROW #endif -#if defined(NLOHMANN_JSON_HEDLEY_FALL_THROUGH) - #undef NLOHMANN_JSON_HEDLEY_FALL_THROUGH +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH #endif #if \ defined(__cplusplus) && \ - (!defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) || NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ - !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + !defined(JSON_HEDLEY_PGI_VERSION) #if \ (__cplusplus >= 201703L) || \ - ((__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[fallthrough]] - #elif (__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[clang::fallthrough]] - #elif (__cplusplus >= 201103L) && NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH [[gnu::fallthrough]] + ((__cplusplus >= 201103L) && JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) + #define JSON_HEDLEY_FALL_THROUGH [[fallthrough]] + #elif (__cplusplus >= 201103L) && JSON_HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) + #define JSON_HEDLEY_FALL_THROUGH [[clang::fallthrough]] + #elif (__cplusplus >= 201103L) && JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define JSON_HEDLEY_FALL_THROUGH [[gnu::fallthrough]] #endif #endif -#if !defined(NLOHMANN_JSON_HEDLEY_FALL_THROUGH) - #if NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#if !defined(JSON_HEDLEY_FALL_THROUGH) + #if JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) #elif defined(__fallthrough) /* SAL */ - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH __fallthrough + #define JSON_HEDLEY_FALL_THROUGH __fallthrough #else - #define NLOHMANN_JSON_HEDLEY_FALL_THROUGH + #define JSON_HEDLEY_FALL_THROUGH #endif #endif -#if defined(NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL) - #undef NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) - #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) #elif defined(_Ret_notnull_) /* SAL */ - #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ #else - #define NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + #define JSON_HEDLEY_RETURNS_NON_NULL #endif -#if defined(NLOHMANN_JSON_HEDLEY_ARRAY_PARAM) - #undef NLOHMANN_JSON_HEDLEY_ARRAY_PARAM +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM #endif #if \ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ !defined(__STDC_NO_VLA__) && \ !defined(__cplusplus) && \ - !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION) && \ - !defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) - #define NLOHMANN_JSON_HEDLEY_ARRAY_PARAM(name) (name) + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) #else - #define NLOHMANN_JSON_HEDLEY_ARRAY_PARAM(name) + #define JSON_HEDLEY_ARRAY_PARAM(name) #endif -#if defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) - #undef NLOHMANN_JSON_HEDLEY_IS_CONSTANT +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT #endif -#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR) - #undef NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR #endif /* Note the double-underscore. For internal use only; no API * guarantees! */ -#if defined(NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR) - #undef NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR +#if defined(JSON_HEDLEY__IS_CONSTEXPR) + #undef JSON_HEDLEY__IS_CONSTEXPR #endif #if \ - NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ - NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ - NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) - #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) #endif #if !defined(__cplusplus) # if \ - NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ - NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ - NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) #if defined(__INTPTR_TYPE__) - #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) + #define JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) #else #include - #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) + #define JSON_HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) #endif # elif \ - (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION) && !defined(NLOHMANN_JSON_HEDLEY_PGI_VERSION)) || \ - NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ - NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ - NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(JSON_HEDLEY_SUNPRO_VERSION) && !defined(JSON_HEDLEY_PGI_VERSION)) || \ + JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) #if defined(__INTPTR_TYPE__) - #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) + #define JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) #else #include - #define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) + #define JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) #endif # elif \ - defined(NLOHMANN_JSON_HEDLEY_GCC_VERSION) || \ - defined(NLOHMANN_JSON_HEDLEY_INTEL_VERSION) || \ - defined(NLOHMANN_JSON_HEDLEY_TINYC_VERSION) || \ - defined(NLOHMANN_JSON_HEDLEY_TI_VERSION) || \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_VERSION) || \ defined(__clang__) -# define NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) ( \ +# define JSON_HEDLEY__IS_CONSTEXPR(expr) ( \ sizeof(void) != \ sizeof(*( \ 1 ? \ @@ -1380,241 +1380,241 @@ NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP ((struct { char v[sizeof(void) * 2]; } *) 1) \ ) \ ) \ - ) + ) # endif #endif -#if defined(NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR) - #if !defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) - #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) +#if defined(JSON_HEDLEY__IS_CONSTEXPR) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY__IS_CONSTEXPR(expr) #endif - #define NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (NLOHMANN_JSON_HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) #else - #if !defined(NLOHMANN_JSON_HEDLEY_IS_CONSTANT) - #define NLOHMANN_JSON_HEDLEY_IS_CONSTANT(expr) (0) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) #endif - #define NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) #endif -#if defined(NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS) - #undef NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS #endif -#if defined(NLOHMANN_JSON_HEDLEY_END_C_DECLS) - #undef NLOHMANN_JSON_HEDLEY_END_C_DECLS +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS #endif -#if defined(NLOHMANN_JSON_HEDLEY_C_DECL) - #undef NLOHMANN_JSON_HEDLEY_C_DECL +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL #endif #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS extern "C" { - #define NLOHMANN_JSON_HEDLEY_END_C_DECLS } - #define NLOHMANN_JSON_HEDLEY_C_DECL extern "C" + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" #else - #define NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS - #define NLOHMANN_JSON_HEDLEY_END_C_DECLS - #define NLOHMANN_JSON_HEDLEY_C_DECL + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL #endif -#if defined(NLOHMANN_JSON_HEDLEY_STATIC_ASSERT) - #undef NLOHMANN_JSON_HEDLEY_STATIC_ASSERT +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT #endif #if \ !defined(__cplusplus) && ( \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ - NLOHMANN_JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ defined(_Static_assert) \ ) -# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) #elif \ (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ - NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ - (defined(__cplusplus) && NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK(8,3,0)) -# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + (defined(__cplusplus) && JSON_HEDLEY_TI_VERSION_CHECK(8,3,0)) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) #elif defined(__cplusplus) && (__cplusplus >= 201103L) -# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) #else -# define NLOHMANN_JSON_HEDLEY_STATIC_ASSERT(expr, message) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CONST_CAST) - #undef NLOHMANN_JSON_HEDLEY_CONST_CAST +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST #endif #if defined(__cplusplus) -# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) #elif \ - NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) -# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ ((T) (expr)); \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP \ + JSON_HEDLEY_DIAGNOSTIC_POP \ })) #else -# define NLOHMANN_JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) #endif -#if defined(NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST) - #undef NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST #endif #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) #else - #define NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr))) #endif -#if defined(NLOHMANN_JSON_HEDLEY_STATIC_CAST) - #undef NLOHMANN_JSON_HEDLEY_STATIC_CAST +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST #endif #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) #else - #define NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CPP_CAST) - #undef NLOHMANN_JSON_HEDLEY_CPP_CAST +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST #endif #if defined(__cplusplus) - #define NLOHMANN_JSON_HEDLEY_CPP_CAST(T, expr) static_cast(expr) + #define JSON_HEDLEY_CPP_CAST(T, expr) static_cast(expr) #else - #define NLOHMANN_JSON_HEDLEY_CPP_CAST(T, expr) (expr) + #define JSON_HEDLEY_CPP_CAST(T, expr) (expr) #endif -#if defined(NLOHMANN_JSON_HEDLEY_MESSAGE) - #undef NLOHMANN_JSON_HEDLEY_MESSAGE +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - NLOHMANN_JSON_HEDLEY_PRAGMA(message msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP #elif \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ - NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message msg) -#elif NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(_CRI message msg) -#elif NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) -#elif NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) #else -# define NLOHMANN_JSON_HEDLEY_MESSAGE(msg) +# define JSON_HEDLEY_MESSAGE(msg) #endif -#if defined(NLOHMANN_JSON_HEDLEY_WARNING) - #undef NLOHMANN_JSON_HEDLEY_WARNING +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING #endif -#if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") -# define NLOHMANN_JSON_HEDLEY_WARNING(msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - NLOHMANN_JSON_HEDLEY_PRAGMA(clang warning msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP #elif \ - NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ - NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) -# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(GCC warning msg) -#elif NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) -# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_PRAGMA(message(msg)) + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) #else -# define NLOHMANN_JSON_HEDLEY_WARNING(msg) NLOHMANN_JSON_HEDLEY_MESSAGE(msg) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) #endif -#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE_MSG) - #undef NLOHMANN_JSON_HEDLEY_REQUIRE_MSG +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG #endif -#if NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) -# if NLOHMANN_JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") -# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE_MSG(expr, msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ __attribute__((__diagnose_if__(!(expr), msg, "error"))) \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP + JSON_HEDLEY_DIAGNOSTIC_POP # else -# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) # endif #else -# define NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, msg) +# define JSON_HEDLEY_REQUIRE_MSG(expr, msg) #endif -#if defined(NLOHMANN_JSON_HEDLEY_REQUIRE) - #undef NLOHMANN_JSON_HEDLEY_REQUIRE +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE #endif -#define NLOHMANN_JSON_HEDLEY_REQUIRE(expr) NLOHMANN_JSON_HEDLEY_REQUIRE_MSG(expr, #expr) +#define JSON_HEDLEY_REQUIRE(expr) JSON_HEDLEY_REQUIRE_MSG(expr, #expr) -#if defined(NLOHMANN_JSON_HEDLEY_FLAGS) - #undef NLOHMANN_JSON_HEDLEY_FLAGS +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS #endif -#if NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) - #define NLOHMANN_JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) #endif -#if defined(NLOHMANN_JSON_HEDLEY_FLAGS_CAST) - #undef NLOHMANN_JSON_HEDLEY_FLAGS_CAST +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST #endif -#if NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) -# define NLOHMANN_JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH \ +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("warning(disable:188)") \ ((T) (expr)); \ - NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP \ + JSON_HEDLEY_DIAGNOSTIC_POP \ })) #else -# define NLOHMANN_JSON_HEDLEY_FLAGS_CAST(T, expr) NLOHMANN_JSON_HEDLEY_STATIC_CAST(T, expr) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) #endif /* Remaining macros are deprecated. */ -#if defined(NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) - #undef NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK #endif #if defined(__clang__) - #define NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) #else - #define NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) NLOHMANN_JSON_HEDLEY_HAS_BUILTIN(builtin) +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE(feature) NLOHMANN_JSON_HEDLEY_HAS_FEATURE(feature) +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) NLOHMANN_JSON_HEDLEY_HAS_EXTENSION(extension) +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) -#if defined(NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING) - #undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING #endif -#define NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING(warning) NLOHMANN_JSON_HEDLEY_HAS_WARNING(warning) +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) -#endif /* !defined(NLOHMANN_JSON_HEDLEY_VERSION) || (NLOHMANN_JSON_HEDLEY_VERSION < X) */ +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ // This file contains all internal macro definitions @@ -1775,7 +1775,7 @@ class exception : public std::exception { public: /// returns the explanatory string - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL const char* what() const noexcept override { return m.what(); @@ -1785,7 +1785,7 @@ class exception : public std::exception const int id; protected: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} static std::string name(const std::string& ename, int id_) @@ -1938,7 +1938,7 @@ class invalid_iterator : public exception } private: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) invalid_iterator(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -1992,7 +1992,7 @@ class type_error : public exception } private: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -2039,7 +2039,7 @@ class out_of_range : public exception } private: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} }; @@ -2077,7 +2077,7 @@ class other_error : public exception } private: - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} }; } // namespace detail @@ -2794,7 +2794,7 @@ namespace detail template void from_json(const BasicJsonType& j, typename std::nullptr_t& n) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_null())) + if (JSON_HEDLEY_UNLIKELY(not j.is_null())) { JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); } @@ -2834,7 +2834,7 @@ void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) template void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_boolean())) + if (JSON_HEDLEY_UNLIKELY(not j.is_boolean())) { JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); } @@ -2844,7 +2844,7 @@ void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) template void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_string())) + if (JSON_HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -2860,7 +2860,7 @@ template < int > = 0 > void from_json(const BasicJsonType& j, ConstructibleStringType& s) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_string())) + if (JSON_HEDLEY_UNLIKELY(not j.is_string())) { JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); } @@ -2900,7 +2900,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::forward_list& l) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -2917,7 +2917,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, std::valarray& l) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } @@ -3004,7 +3004,7 @@ auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) j.template get(), void()) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); @@ -3017,7 +3017,7 @@ template::value, int> = 0> void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_object())) + if (JSON_HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); } @@ -3100,14 +3100,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::map& m) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not p.is_array())) + if (JSON_HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -3120,14 +3120,14 @@ template ::value>> void from_json(const BasicJsonType& j, std::unordered_map& m) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_array())) + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); } m.clear(); for (const auto& p : j) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not p.is_array())) + if (JSON_HEDLEY_UNLIKELY(not p.is_array())) { JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); } @@ -3806,7 +3806,7 @@ Input adapter for stdio file access. This adapter read only 1 byte and do not us class file_input_adapter : public input_adapter_protocol { public: - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) explicit file_input_adapter(std::FILE* f) noexcept : m_file(f) {} @@ -3882,7 +3882,7 @@ class input_stream_adapter : public input_adapter_protocol class input_buffer_adapter : public input_adapter_protocol { public: - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) input_buffer_adapter(const char* b, const std::size_t l) noexcept : cursor(b), limit(b + l) {} @@ -3896,7 +3896,7 @@ class input_buffer_adapter : public input_adapter_protocol std::char_traits::int_type get_character() noexcept override { - if (NLOHMANN_JSON_HEDLEY_LIKELY(cursor < limit)) + if (JSON_HEDLEY_LIKELY(cursor < limit)) { return std::char_traits::to_int_type(*(cursor++)); } @@ -4086,7 +4086,7 @@ class input_adapter { public: // native support - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) input_adapter(std::FILE* file) : ia(std::make_shared(file)) {} /// input adapter for input stream @@ -4155,7 +4155,7 @@ class input_adapter "each element in the iterator range must have the size of 1 byte"); const auto len = static_cast(std::distance(first, last)); - if (NLOHMANN_JSON_HEDLEY_LIKELY(len > 0)) + if (JSON_HEDLEY_LIKELY(len > 0)) { // there is at least one element: use the address of first ia = std::make_shared(reinterpret_cast(&(*first)), len); @@ -4403,7 +4403,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); @@ -4429,7 +4429,7 @@ class json_sax_dom_parser { ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); @@ -4485,7 +4485,7 @@ class json_sax_dom_parser object to which we can add elements */ template - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL BasicJsonType* handle_value(Value&& v) { if (ref_stack.empty()) @@ -4592,7 +4592,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check object limit - if (ref_stack.back() and NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); } @@ -4655,7 +4655,7 @@ class json_sax_dom_callback_parser ref_stack.push_back(val.second); // check array limit - if (ref_stack.back() and NLOHMANN_JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + if (ref_stack.back() and JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); } @@ -5094,7 +5094,7 @@ class binary_reader @return */ - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) bool sax_parse(const input_format_t format, json_sax_t* sax_, const bool strict = true) @@ -5136,7 +5136,7 @@ class binary_reader get(); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current != std::char_traits::eof())) + if (JSON_HEDLEY_UNLIKELY(current != std::char_traits::eof())) { return sax->parse_error(chars_read, get_token_string(), parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); @@ -5172,12 +5172,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) { return false; } @@ -5198,7 +5198,7 @@ class binary_reader while (true) { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) { return false; } @@ -5226,7 +5226,7 @@ class binary_reader template bool get_bson_string(const NumberType len, string_t& result) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(len < 1)) + if (JSON_HEDLEY_UNLIKELY(len < 1)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); @@ -5321,13 +5321,13 @@ class binary_reader string_t key; while (int element_type = get()) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) { return false; } const std::size_t element_type_parse_position = chars_read; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_bson_cstr(key))) + if (JSON_HEDLEY_UNLIKELY(not get_bson_cstr(key))) { return false; } @@ -5337,7 +5337,7 @@ class binary_reader return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) { return false; } @@ -5358,12 +5358,12 @@ class binary_reader std::int32_t document_size; get_number(input_format_t::bson, document_size); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) { return false; } @@ -5648,12 +5648,12 @@ class binary_reader case 0xF9: // Half-Precision Float (two-byte IEEE 754) { const int byte1_raw = get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } const int byte2_raw = get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) { return false; } @@ -5726,7 +5726,7 @@ class binary_reader */ bool get_cbor_string(string_t& result) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) { return false; } @@ -5815,7 +5815,7 @@ class binary_reader */ bool get_cbor_array(const std::size_t len) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } @@ -5824,7 +5824,7 @@ class binary_reader { for (std::size_t i = 0; i < len; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -5834,7 +5834,7 @@ class binary_reader { while (get() != 0xFF) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal(false))) + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal(false))) { return false; } @@ -5851,7 +5851,7 @@ class binary_reader */ bool get_cbor_object(const std::size_t len) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -5862,12 +5862,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -5878,12 +5878,12 @@ class binary_reader { while (get() != 0xFF) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) { return false; } @@ -6272,7 +6272,7 @@ class binary_reader */ bool get_msgpack_string(string_t& result) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) { return false; } @@ -6348,14 +6348,14 @@ class binary_reader */ bool get_msgpack_array(const std::size_t len) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) { return false; } for (std::size_t i = 0; i < len; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -6370,7 +6370,7 @@ class binary_reader */ bool get_msgpack_object(const std::size_t len) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) { return false; } @@ -6379,12 +6379,12 @@ class binary_reader for (std::size_t i = 0; i < len; ++i) { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) { return false; } @@ -6431,7 +6431,7 @@ class binary_reader get(); // TODO(niels): may we ignore N here? } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -6485,7 +6485,7 @@ class binary_reader case 'U': { std::uint8_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6496,7 +6496,7 @@ class binary_reader case 'i': { std::int8_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6507,7 +6507,7 @@ class binary_reader case 'I': { std::int16_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6518,7 +6518,7 @@ class binary_reader case 'l': { std::int32_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6529,7 +6529,7 @@ class binary_reader case 'L': { std::int64_t number; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) { return false; } @@ -6565,15 +6565,15 @@ class binary_reader if (current == '$') { result.second = get(); // must not ignore 'N', because 'N' maybe the type - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) { return false; } get_ignore_noop(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current != '#')) + if (JSON_HEDLEY_UNLIKELY(current != '#')) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) { return false; } @@ -6656,11 +6656,11 @@ class binary_reader case 'C': // char { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current > 127)) + if (JSON_HEDLEY_UNLIKELY(current > 127)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); @@ -6695,14 +6695,14 @@ class binary_reader bool get_ubjson_array() { std::pair size_and_type; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } if (size_and_type.first != string_t::npos) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) { return false; } @@ -6713,7 +6713,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -6724,7 +6724,7 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -6733,14 +6733,14 @@ class binary_reader } else { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } while (current != ']') { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) { return false; } @@ -6757,7 +6757,7 @@ class binary_reader bool get_ubjson_object() { std::pair size_and_type; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) { return false; } @@ -6765,7 +6765,7 @@ class binary_reader string_t key; if (size_and_type.first != string_t::npos) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) { return false; } @@ -6774,11 +6774,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) { return false; } @@ -6789,11 +6789,11 @@ class binary_reader { for (std::size_t i = 0; i < size_and_type.first; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -6803,18 +6803,18 @@ class binary_reader } else { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } while (current != '}') { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) { return false; } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) { return false; } @@ -6880,7 +6880,7 @@ class binary_reader for (std::size_t i = 0; i < sizeof(NumberType); ++i) { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) { return false; } @@ -6924,7 +6924,7 @@ class binary_reader std::generate_n(std::back_inserter(result), len, [this, &success, &format]() { get(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) { success = false; } @@ -6938,10 +6938,10 @@ class binary_reader @param[in] context further context information (for diagnostics) @return whether the last read character is not EOF */ - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) bool unexpect_eof(const input_format_t format, const char* context) const { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(current == std::char_traits::eof())) + if (JSON_HEDLEY_UNLIKELY(current == std::char_traits::eof())) { return sax->parse_error(chars_read, "", parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); @@ -7082,7 +7082,7 @@ class lexer }; /// return name of values of type token_type (only used for errors) - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL static const char* token_type_name(const token_type t) noexcept { switch (t) @@ -7224,7 +7224,7 @@ class lexer for (auto range = ranges.begin(); range != ranges.end(); ++range) { get(); - if (NLOHMANN_JSON_HEDLEY_LIKELY(*range <= current and current <= *(++range))) + if (JSON_HEDLEY_LIKELY(*range <= current and current <= *(++range))) { add(current); } @@ -7323,7 +7323,7 @@ class lexer const int codepoint1 = get_codepoint(); int codepoint = codepoint1; // start with codepoint1 - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) + if (JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; @@ -7333,18 +7333,18 @@ class lexer if (0xD800 <= codepoint1 and codepoint1 <= 0xDBFF) { // expect next \uxxxx entry - if (NLOHMANN_JSON_HEDLEY_LIKELY(get() == '\\' and get() == 'u')) + if (JSON_HEDLEY_LIKELY(get() == '\\' and get() == 'u')) { const int codepoint2 = get_codepoint(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) + if (JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) { error_message = "invalid string: '\\u' must be followed by 4 hex digits"; return token_type::parse_error; } // check if codepoint2 is a low surrogate - if (NLOHMANN_JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) + if (JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) { // overwrite codepoint codepoint = static_cast( @@ -7371,7 +7371,7 @@ class lexer } else { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) + if (JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) { error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; return token_type::parse_error; @@ -7746,7 +7746,7 @@ class lexer case 0xDE: case 0xDF: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) + if (JSON_HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) { return token_type::parse_error; } @@ -7756,7 +7756,7 @@ class lexer // U+0800..U+0FFF: bytes E0 A0..BF 80..BF case 0xE0: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7780,7 +7780,7 @@ class lexer case 0xEE: case 0xEF: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7790,7 +7790,7 @@ class lexer // U+D000..U+D7FF: bytes ED 80..9F 80..BF case 0xED: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7800,7 +7800,7 @@ class lexer // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF case 0xF0: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7812,7 +7812,7 @@ class lexer case 0xF2: case 0xF3: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7822,7 +7822,7 @@ class lexer // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF case 0xF4: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) { return token_type::parse_error; } @@ -7839,19 +7839,19 @@ class lexer } } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); @@ -8227,14 +8227,14 @@ scan_number_done: @param[in] length the length of the passed literal text @param[in] return_type the token type to return on success */ - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) token_type scan_literal(const char* literal_text, const std::size_t length, token_type return_type) { assert(current == literal_text[0]); for (std::size_t i = 1; i < length; ++i) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get() != literal_text[i])) + if (JSON_HEDLEY_UNLIKELY(get() != literal_text[i])) { error_message = "invalid literal"; return token_type::parse_error; @@ -8280,7 +8280,7 @@ scan_number_done: current = ia->get_character(); } - if (NLOHMANN_JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) + if (JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) { token_string.push_back(std::char_traits::to_char_type(current)); } @@ -8321,7 +8321,7 @@ scan_number_done: --position.chars_read_current_line; } - if (NLOHMANN_JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) + if (JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) { assert(not token_string.empty()); token_string.pop_back(); @@ -8400,7 +8400,7 @@ scan_number_done: } /// return syntax error message - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL constexpr const char* get_error_message() const noexcept { return error_message; @@ -8689,7 +8689,7 @@ class parser } template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) bool sax_parse(SAX* sax, const bool strict = true) { (void)detail::is_sax_static_asserts {}; @@ -8709,7 +8709,7 @@ class parser private: template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) bool sax_parse_internal(SAX* sax) { // stack to remember the hierarchy of structured values we are parsing @@ -8727,7 +8727,7 @@ class parser { case token_type::begin_object: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) { return false; } @@ -8735,7 +8735,7 @@ class parser // closing } -> we are done if (get_token() == token_type::end_object) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_object())) + if (JSON_HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -8743,20 +8743,20 @@ class parser } // parse key - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) + if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"))); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -8774,7 +8774,7 @@ class parser case token_type::begin_array: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) { return false; } @@ -8782,7 +8782,7 @@ class parser // closing ] -> we are done if (get_token() == token_type::end_array) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_array())) + if (JSON_HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -8800,14 +8800,14 @@ class parser { const auto res = m_lexer.get_number_float(); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not std::isfinite(res))) + if (JSON_HEDLEY_UNLIKELY(not std::isfinite(res))) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) + if (JSON_HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) { return false; } @@ -8817,7 +8817,7 @@ class parser case token_type::literal_false: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->boolean(false))) + if (JSON_HEDLEY_UNLIKELY(not sax->boolean(false))) { return false; } @@ -8826,7 +8826,7 @@ class parser case token_type::literal_null: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->null())) + if (JSON_HEDLEY_UNLIKELY(not sax->null())) { return false; } @@ -8835,7 +8835,7 @@ class parser case token_type::literal_true: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->boolean(true))) + if (JSON_HEDLEY_UNLIKELY(not sax->boolean(true))) { return false; } @@ -8844,7 +8844,7 @@ class parser case token_type::value_integer: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) + if (JSON_HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) { return false; } @@ -8853,7 +8853,7 @@ class parser case token_type::value_string: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) + if (JSON_HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) { return false; } @@ -8862,7 +8862,7 @@ class parser case token_type::value_unsigned: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) + if (JSON_HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) { return false; } @@ -8910,9 +8910,9 @@ class parser } // closing ] - if (NLOHMANN_JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_array())) + if (JSON_HEDLEY_UNLIKELY(not sax->end_array())) { return false; } @@ -8938,7 +8938,7 @@ class parser if (get_token() == token_type::value_separator) { // parse key - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -8946,13 +8946,13 @@ class parser exception_message(token_type::value_string, "object key"))); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + if (JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) { return false; } // parse separator (:) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) { return sax->parse_error(m_lexer.get_position(), m_lexer.get_token_string(), @@ -8966,9 +8966,9 @@ class parser } // closing } - if (NLOHMANN_JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not sax->end_object())) + if (JSON_HEDLEY_UNLIKELY(not sax->end_object())) { return false; } @@ -9452,7 +9452,7 @@ class iter_impl default: { - if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return *m_object; } @@ -9486,7 +9486,7 @@ class iter_impl default: { - if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) { return m_object; } @@ -9589,7 +9589,7 @@ class iter_impl bool operator==(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -9625,7 +9625,7 @@ class iter_impl bool operator<(const iter_impl& other) const { // if objects are not the same, the comparison is undefined - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) { JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); } @@ -9785,7 +9785,7 @@ class iter_impl default: { - if (NLOHMANN_JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) { return *m_object; } @@ -9803,7 +9803,7 @@ class iter_impl { assert(m_object != nullptr); - if (NLOHMANN_JSON_HEDLEY_LIKELY(m_object->is_object())) + if (JSON_HEDLEY_LIKELY(m_object->is_object())) { return m_it.object_iterator->first; } @@ -10204,7 +10204,7 @@ class json_pointer */ void pop_back() { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) + if (JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -10228,7 +10228,7 @@ class json_pointer */ const std::string& back() { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) + if (JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -10292,7 +10292,7 @@ class json_pointer const int res = std::stoi(s, &processed_chars); // check if the string was completely read - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) + if (JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) { JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); } @@ -10302,7 +10302,7 @@ class json_pointer json_pointer top() const { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty())) + if (JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); } @@ -10434,7 +10434,7 @@ class json_pointer case detail::value_t::array: { // error condition (cf. RFC 6901, Sect. 4) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -10492,7 +10492,7 @@ class json_pointer case detail::value_t::array: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -10501,7 +10501,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -10557,7 +10557,7 @@ class json_pointer case detail::value_t::array: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" cannot be used for const access JSON_THROW(detail::out_of_range::create(402, @@ -10566,7 +10566,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -10616,7 +10616,7 @@ class json_pointer case detail::value_t::array: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-")) + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) { // "-" always fails the range check JSON_THROW(detail::out_of_range::create(402, @@ -10625,7 +10625,7 @@ class json_pointer } // error condition (cf. RFC 6901, Sect. 4) - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, "array index '" + reference_token + @@ -10672,7 +10672,7 @@ class json_pointer } // check if nonempty reference string begins with slash - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) + if (JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) { JSON_THROW(detail::parse_error::create(107, 1, "JSON pointer must be empty or begin with '/' - was: '" + @@ -10707,9 +10707,9 @@ class json_pointer assert(reference_token[pos] == '~'); // ~ must be followed by 0 or 1 - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or - (reference_token[pos + 1] != '0' and - reference_token[pos + 1] != '1'))) + if (JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or + (reference_token[pos + 1] != '0' and + reference_token[pos + 1] != '1'))) { JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); } @@ -10834,7 +10834,7 @@ class json_pointer static BasicJsonType unflatten(const BasicJsonType& value) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not value.is_object())) + if (JSON_HEDLEY_UNLIKELY(not value.is_object())) { JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); } @@ -10844,7 +10844,7 @@ class json_pointer // iterate the JSON object values for (const auto& element : *value.m_value.object) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not element.second.is_primitive())) + if (JSON_HEDLEY_UNLIKELY(not element.second.is_primitive())) { JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); } @@ -11034,7 +11034,7 @@ class output_vector_adapter : public output_adapter_protocol v.push_back(c); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { std::copy(s, s + length, std::back_inserter(v)); @@ -11058,7 +11058,7 @@ class output_stream_adapter : public output_adapter_protocol stream.put(c); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { stream.write(s, static_cast(length)); @@ -11082,7 +11082,7 @@ class output_string_adapter : public output_adapter_protocol str.push_back(c); } - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { str.append(s, length); @@ -11821,7 +11821,7 @@ class binary_writer static std::size_t calc_bson_entry_header_size(const string_t& name) { const auto it = name.find(static_cast(0)); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) + if (JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) { JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); @@ -13283,7 +13283,7 @@ v = buf * 10^decimal_exponent len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_NON_NULL(1) inline void grisu2(char* buf, int& len, int& decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) { @@ -13343,7 +13343,7 @@ len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10. */ template -NLOHMANN_JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_NON_NULL(1) void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) { static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, @@ -13382,8 +13382,8 @@ void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) @return a pointer to the element following the exponent. @pre -1000 < e < 1000 */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) -NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL inline char* append_exponent(char* buf, int e) { assert(e > -1000); @@ -13434,8 +13434,8 @@ notation. Otherwise it will be printed in exponential notation. @pre min_exp < 0 @pre max_exp > 0 */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) -NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL inline char* format_buffer(char* buf, int len, int decimal_exponent, int min_exp, int max_exp) { @@ -13519,8 +13519,8 @@ format. Returns an iterator pointing past-the-end of the decimal representation. @note The result is NOT null-terminated. */ template -NLOHMANN_JSON_HEDLEY_NON_NULL(1, 2) -NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL +JSON_HEDLEY_NON_NULL(1, 2) +JSON_HEDLEY_RETURNS_NON_NULL char* to_chars(char* first, const char* last, FloatType value) { static_cast(last); // maybe unused - fix warning @@ -13670,7 +13670,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -13743,7 +13743,7 @@ class serializer // variable to hold indentation for recursive calls const auto new_indent = current_indent + indent_step; - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) { indent_string.resize(indent_string.size() * 2, ' '); } @@ -14058,7 +14058,7 @@ class serializer } // we finished processing the string - if (NLOHMANN_JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) + if (JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) { // write buffer if (bytes > 0) @@ -14651,7 +14651,7 @@ class basic_json @since 2.1.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json meta() { basic_json result; @@ -15156,7 +15156,7 @@ class basic_json /// helper for exception-safe object creation template - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL static T* create(Args&& ... args) { AllocatorType alloc; @@ -15283,7 +15283,7 @@ class basic_json default: { object = nullptr; // silence warning, see #821 - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(t == value_t::null)) + if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) { JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.6.1")); // LCOV_EXCL_LINE } @@ -15760,7 +15760,7 @@ class basic_json } // if object is wanted but impossible, throw an exception - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) + if (JSON_HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) { JSON_THROW(type_error::create(301, "cannot create object from initializer list")); } @@ -15827,7 +15827,7 @@ class basic_json @since version 1.0.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json array(initializer_list_t init = {}) { return basic_json(init, false, value_t::array); @@ -15871,7 +15871,7 @@ class basic_json @since version 1.0.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json object(initializer_list_t init = {}) { return basic_json(init, false, value_t::object); @@ -15970,7 +15970,7 @@ class basic_json assert(last.m_object != nullptr); // make sure iterator fits the current value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); } @@ -15987,8 +15987,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (JSON_HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -16701,7 +16701,7 @@ class basic_json /// get a boolean (explicit) boolean_t get_impl(boolean_t* /*unused*/) const { - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_boolean())) + if (JSON_HEDLEY_LIKELY(is_boolean())) { return m_value.boolean; } @@ -16810,7 +16810,7 @@ class basic_json // delegate the call to get_ptr<>() auto ptr = obj.template get_ptr::type>(); - if (NLOHMANN_JSON_HEDLEY_LIKELY(ptr != nullptr)) + if (JSON_HEDLEY_LIKELY(ptr != nullptr)) { return *ptr; } @@ -17261,7 +17261,7 @@ class basic_json reference at(size_type idx) { // at only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -17308,7 +17308,7 @@ class basic_json const_reference at(size_type idx) const { // at only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { JSON_TRY { @@ -17359,7 +17359,7 @@ class basic_json reference at(const typename object_t::key_type& key) { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -17410,7 +17410,7 @@ class basic_json const_reference at(const typename object_t::key_type& key) const { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { JSON_TRY { @@ -17464,7 +17464,7 @@ class basic_json } // operator[] only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { // fill up array with null values if given idx is outside range if (idx >= m_value.array->size()) @@ -17502,7 +17502,7 @@ class basic_json const_reference operator[](size_type idx) const { // const operator[] only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { return m_value.array->operator[](idx); } @@ -17548,7 +17548,7 @@ class basic_json } // operator[] only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -17589,7 +17589,7 @@ class basic_json const_reference operator[](const typename object_t::key_type& key) const { // const operator[] only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -17626,7 +17626,7 @@ class basic_json @since version 1.1.0 */ template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) reference operator[](T* key) { // implicitly convert null to object @@ -17638,7 +17638,7 @@ class basic_json } // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->operator[](key); } @@ -17677,11 +17677,11 @@ class basic_json @since version 1.1.0 */ template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) const_reference operator[](T* key) const { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { assert(m_value.object->find(key) != m_value.object->end()); return m_value.object->find(key)->second; @@ -17745,7 +17745,7 @@ class basic_json ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { // if key is found, return value and given default value otherwise const auto it = find(key); @@ -17817,7 +17817,7 @@ class basic_json ValueType value(const json_pointer& ptr, const ValueType& default_value) const { // at only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { // if pointer resolves a value, return it or use default value JSON_TRY @@ -17837,7 +17837,7 @@ class basic_json @brief overload for a default value of type const char* @copydoc basic_json::value(const json_pointer&, ValueType) const */ - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) string_t value(const json_pointer& ptr, const char* default_value) const { return value(ptr, string_t(default_value)); @@ -17982,7 +17982,7 @@ class basic_json IteratorType erase(IteratorType pos) { // make sure iterator fits the current value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(this != pos.m_object)) + if (JSON_HEDLEY_UNLIKELY(this != pos.m_object)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -17997,7 +17997,7 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) + if (JSON_HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) { JSON_THROW(invalid_iterator::create(205, "iterator out of range")); } @@ -18087,7 +18087,7 @@ class basic_json IteratorType erase(IteratorType first, IteratorType last) { // make sure iterator fits the current value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) { JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); } @@ -18102,8 +18102,8 @@ class basic_json case value_t::number_unsigned: case value_t::string: { - if (NLOHMANN_JSON_HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() - or not last.m_it.primitive_iterator.is_end())) + if (JSON_HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) { JSON_THROW(invalid_iterator::create(204, "iterators out of range")); } @@ -18174,7 +18174,7 @@ class basic_json size_type erase(const typename object_t::key_type& key) { // this erase only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { return m_value.object->erase(key); } @@ -18209,9 +18209,9 @@ class basic_json void erase(const size_type idx) { // this erase only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(idx >= size())) + if (JSON_HEDLEY_UNLIKELY(idx >= size())) { JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); } @@ -18687,7 +18687,7 @@ class basic_json future 4.0.0 of the library. Please use @ref items() instead; that is, replace `json::iterator_wrapper(j)` with `j.items()`. */ - NLOHMANN_JSON_HEDLEY_DEPRECATED(3.1.0) + JSON_HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(reference ref) noexcept { return ref.items(); @@ -18696,7 +18696,7 @@ class basic_json /*! @copydoc iterator_wrapper(reference) */ - NLOHMANN_JSON_HEDLEY_DEPRECATED(3.1.0) + JSON_HEDLEY_DEPRECATED(3.1.0) static iteration_proxy iterator_wrapper(const_reference ref) noexcept { return ref.items(); @@ -19115,7 +19115,7 @@ class basic_json void push_back(basic_json&& val) { // push_back only works for null objects or arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -19152,7 +19152,7 @@ class basic_json void push_back(const basic_json& val) { // push_back only works for null objects or arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -19202,7 +19202,7 @@ class basic_json void push_back(const typename object_t::value_type& val) { // push_back only works for null objects or objects - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); } @@ -19303,7 +19303,7 @@ class basic_json void emplace_back(Args&& ... args) { // emplace_back only works for null objects or arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); } @@ -19351,7 +19351,7 @@ class basic_json std::pair emplace(Args&& ... args) { // emplace only works for null objects or arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); } @@ -19419,10 +19419,10 @@ class basic_json iterator insert(const_iterator pos, const basic_json& val) { // insert only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -19470,10 +19470,10 @@ class basic_json iterator insert(const_iterator pos, size_type cnt, const basic_json& val) { // insert only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { // check if iterator pos fits to this JSON value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -19518,24 +19518,24 @@ class basic_json iterator insert(const_iterator pos, const_iterator first, const_iterator last) { // insert only works for arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_array())) + if (JSON_HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } // check if range iterators belong to the same JSON object - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object == this)) + if (JSON_HEDLEY_UNLIKELY(first.m_object == this)) { JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); } @@ -19571,13 +19571,13 @@ class basic_json iterator insert(const_iterator pos, initializer_list_t ilist) { // insert only works for arrays - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_array())) + if (JSON_HEDLEY_UNLIKELY(not is_array())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if iterator pos fits to this JSON value - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); } @@ -19612,19 +19612,19 @@ class basic_json void insert(const_iterator first, const_iterator last) { // insert only works for objects - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) + if (JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_object->is_object())) + if (JSON_HEDLEY_UNLIKELY(not first.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -19661,11 +19661,11 @@ class basic_json assert_invariant(); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) + if (JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not j.is_object())) + if (JSON_HEDLEY_UNLIKELY(not j.is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); } @@ -19712,20 +19712,20 @@ class basic_json assert_invariant(); } - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not is_object())) + if (JSON_HEDLEY_UNLIKELY(not is_object())) { JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); } // check if range iterators belong to the same JSON object - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) { JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); } // passed iterators must belong to objects - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not first.m_object->is_object() - or not last.m_object->is_object())) + if (JSON_HEDLEY_UNLIKELY(not first.m_object->is_object() + or not last.m_object->is_object())) { JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); } @@ -19788,7 +19788,7 @@ class basic_json void swap(array_t& other) { // swap only works for arrays - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_array())) + if (JSON_HEDLEY_LIKELY(is_array())) { std::swap(*(m_value.array), other); } @@ -19821,7 +19821,7 @@ class basic_json void swap(object_t& other) { // swap only works for objects - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_object())) + if (JSON_HEDLEY_LIKELY(is_object())) { std::swap(*(m_value.object), other); } @@ -19854,7 +19854,7 @@ class basic_json void swap(string_t& other) { // swap only works for strings - if (NLOHMANN_JSON_HEDLEY_LIKELY(is_string())) + if (JSON_HEDLEY_LIKELY(is_string())) { std::swap(*(m_value.string), other); } @@ -20364,7 +20364,7 @@ class basic_json instead; that is, replace calls like `j >> o;` with `o << j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - NLOHMANN_JSON_HEDLEY_DEPRECATED(3.0.0) + JSON_HEDLEY_DEPRECATED(3.0.0) friend std::ostream& operator>>(const basic_json& j, std::ostream& o) { return o << j; @@ -20443,7 +20443,7 @@ class basic_json @since version 2.0.3 (contiguous containers) */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json parse(detail::input_adapter&& i, const parser_callback_t cb = nullptr, const bool allow_exceptions = true) @@ -20512,7 +20512,7 @@ class basic_json @since version 3.2.0 */ template - NLOHMANN_JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_NON_NULL(2) static bool sax_parse(detail::input_adapter&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true) @@ -20598,7 +20598,7 @@ class basic_json std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits::iterator_category>::value, int>::type = 0> - NLOHMANN_JSON_HEDLEY_NON_NULL(3) + JSON_HEDLEY_NON_NULL(3) static bool sax_parse(IteratorType first, IteratorType last, SAX* sax) { return parser(detail::input_adapter(first, last)).sax_parse(sax); @@ -20612,7 +20612,7 @@ class basic_json instead; that is, replace calls like `j << i;` with `i >> j;`. @since version 1.0.0; deprecated since version 3.0.0 */ - NLOHMANN_JSON_HEDLEY_DEPRECATED(3.0.0) + JSON_HEDLEY_DEPRECATED(3.0.0) friend std::istream& operator<<(basic_json& j, std::istream& i) { return operator>>(i, j); @@ -20685,7 +20685,7 @@ class basic_json @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` since 3.0.0 */ - NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_RETURNS_NON_NULL const char* type_name() const noexcept { { @@ -21215,7 +21215,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -21231,7 +21231,7 @@ class basic_json */ template::value, int> = 0> - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -21324,7 +21324,7 @@ class basic_json @a strict parameter since 3.0.0; added @a allow_exceptions parameter since 3.2.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -21340,7 +21340,7 @@ class basic_json */ template::value, int> = 0> - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -21412,7 +21412,7 @@ class basic_json @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -21428,7 +21428,7 @@ class basic_json */ template::value, int> = 0> - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -21499,7 +21499,7 @@ class basic_json @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the related UBJSON format */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) @@ -21515,7 +21515,7 @@ class basic_json */ template::value, int> = 0> - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) @@ -21889,7 +21889,7 @@ class basic_json else { const auto idx = json_pointer::array_index(last_path); - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) + if (JSON_HEDLEY_UNLIKELY(static_cast(idx) > parent.size())) { // avoid undefined behavior JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); @@ -21920,7 +21920,7 @@ class basic_json { // perform range check auto it = parent.find(last_path); - if (NLOHMANN_JSON_HEDLEY_LIKELY(it != parent.end())) + if (JSON_HEDLEY_LIKELY(it != parent.end())) { parent.erase(it); } @@ -21937,7 +21937,7 @@ class basic_json }; // type check: top level value must be an array - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not json_patch.is_array())) + if (JSON_HEDLEY_UNLIKELY(not json_patch.is_array())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -21957,13 +21957,13 @@ class basic_json const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; // check if desired value is present - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) + if (JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); } // check if result is of type string - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(string_type and not it->second.is_string())) + if (JSON_HEDLEY_UNLIKELY(string_type and not it->second.is_string())) { JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); } @@ -21973,7 +21973,7 @@ class basic_json }; // type check: every element of the array must be an object - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not val.is_object())) + if (JSON_HEDLEY_UNLIKELY(not val.is_object())) { JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); } @@ -22051,7 +22051,7 @@ class basic_json } // throw an exception if test fails - if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not success)) + if (JSON_HEDLEY_UNLIKELY(not success)) { JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); } @@ -22104,7 +22104,7 @@ class basic_json @since version 2.0.0 */ - NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json diff(const basic_json& source, const basic_json& target, const std::string& path = "") { @@ -22396,7 +22396,7 @@ if no parse error occurred. @since version 1.0.0 */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_NON_NULL(1) inline nlohmann::json operator "" _json(const char* s, std::size_t n) { return nlohmann::json::parse(s, s + n); @@ -22415,7 +22415,7 @@ object if no parse error occurred. @since version 2.0.0 */ -NLOHMANN_JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_NON_NULL(1) inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) { return nlohmann::json::json_pointer(std::string(s, n)); @@ -22443,127 +22443,127 @@ inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std #undef NLOHMANN_BASIC_JSON_TPL // #include -#undef NLOHMANN_JSON_HEDLEY_ALWAYS_INLINE -#undef NLOHMANN_JSON_HEDLEY_ARM_VERSION -#undef NLOHMANN_JSON_HEDLEY_ARM_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_ARRAY_PARAM -#undef NLOHMANN_JSON_HEDLEY_ASSUME -#undef NLOHMANN_JSON_HEDLEY_BEGIN_C_DECLS -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_BUILTIN -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_EXTENSION -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_FEATURE -#undef NLOHMANN_JSON_HEDLEY_CLANG_HAS_WARNING -#undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION -#undef NLOHMANN_JSON_HEDLEY_COMPCERT_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_CONCAT -#undef NLOHMANN_JSON_HEDLEY_CONCAT_EX -#undef NLOHMANN_JSON_HEDLEY_CONST -#undef NLOHMANN_JSON_HEDLEY_CONSTEXPR -#undef NLOHMANN_JSON_HEDLEY_CONST_CAST -#undef NLOHMANN_JSON_HEDLEY_CPP_CAST -#undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION -#undef NLOHMANN_JSON_HEDLEY_CRAY_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_C_DECL -#undef NLOHMANN_JSON_HEDLEY_DEPRECATED -#undef NLOHMANN_JSON_HEDLEY_DEPRECATED_FOR -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_POP -#undef NLOHMANN_JSON_HEDLEY_DIAGNOSTIC_PUSH -#undef NLOHMANN_JSON_HEDLEY_DMC_VERSION -#undef NLOHMANN_JSON_HEDLEY_DMC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION -#undef NLOHMANN_JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_END_C_DECLS -#undef NLOHMANN_JSON_HEDLEY_FALL_THROUGH -#undef NLOHMANN_JSON_HEDLEY_FLAGS -#undef NLOHMANN_JSON_HEDLEY_FLAGS_CAST -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_BUILTIN -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_EXTENSION -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_FEATURE -#undef NLOHMANN_JSON_HEDLEY_GCC_HAS_WARNING -#undef NLOHMANN_JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_GCC_VERSION -#undef NLOHMANN_JSON_HEDLEY_GCC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_BUILTIN -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_EXTENSION -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_FEATURE -#undef NLOHMANN_JSON_HEDLEY_GNUC_HAS_WARNING -#undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION -#undef NLOHMANN_JSON_HEDLEY_GNUC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_HAS_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_HAS_BUILTIN -#undef NLOHMANN_JSON_HEDLEY_HAS_CPP_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE -#undef NLOHMANN_JSON_HEDLEY_HAS_EXTENSION -#undef NLOHMANN_JSON_HEDLEY_HAS_FEATURE -#undef NLOHMANN_JSON_HEDLEY_HAS_WARNING -#undef NLOHMANN_JSON_HEDLEY_IAR_VERSION -#undef NLOHMANN_JSON_HEDLEY_IAR_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_IBM_VERSION -#undef NLOHMANN_JSON_HEDLEY_IBM_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_IMPORT -#undef NLOHMANN_JSON_HEDLEY_INLINE -#undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION -#undef NLOHMANN_JSON_HEDLEY_INTEL_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_IS_CONSTANT -#undef NLOHMANN_JSON_HEDLEY_LIKELY -#undef NLOHMANN_JSON_HEDLEY_MALLOC -#undef NLOHMANN_JSON_HEDLEY_MESSAGE -#undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION -#undef NLOHMANN_JSON_HEDLEY_MSVC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_NEVER_INLINE -#undef NLOHMANN_JSON_HEDLEY_NON_NULL -#undef NLOHMANN_JSON_HEDLEY_NO_RETURN -#undef NLOHMANN_JSON_HEDLEY_NO_THROW -#undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION -#undef NLOHMANN_JSON_HEDLEY_PELLES_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_PGI_VERSION -#undef NLOHMANN_JSON_HEDLEY_PGI_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_PREDICT -#undef NLOHMANN_JSON_HEDLEY_PRINTF_FORMAT -#undef NLOHMANN_JSON_HEDLEY_PRIVATE -#undef NLOHMANN_JSON_HEDLEY_PUBLIC -#undef NLOHMANN_JSON_HEDLEY_PURE -#undef NLOHMANN_JSON_HEDLEY_REINTERPRET_CAST -#undef NLOHMANN_JSON_HEDLEY_REQUIRE -#undef NLOHMANN_JSON_HEDLEY_REQUIRE_CONSTEXPR -#undef NLOHMANN_JSON_HEDLEY_REQUIRE_MSG -#undef NLOHMANN_JSON_HEDLEY_RESTRICT -#undef NLOHMANN_JSON_HEDLEY_RETURNS_NON_NULL -#undef NLOHMANN_JSON_HEDLEY_SENTINEL -#undef NLOHMANN_JSON_HEDLEY_STATIC_ASSERT -#undef NLOHMANN_JSON_HEDLEY_STATIC_CAST -#undef NLOHMANN_JSON_HEDLEY_STRINGIFY -#undef NLOHMANN_JSON_HEDLEY_STRINGIFY_EX -#undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION -#undef NLOHMANN_JSON_HEDLEY_SUNPRO_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION -#undef NLOHMANN_JSON_HEDLEY_TINYC_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_TI_VERSION -#undef NLOHMANN_JSON_HEDLEY_TI_VERSION_CHECK -#undef NLOHMANN_JSON_HEDLEY_UNAVAILABLE -#undef NLOHMANN_JSON_HEDLEY_UNLIKELY -#undef NLOHMANN_JSON_HEDLEY_UNPREDICTABLE -#undef NLOHMANN_JSON_HEDLEY_UNREACHABLE -#undef NLOHMANN_JSON_HEDLEY_UNREACHABLE_RETURN -#undef NLOHMANN_JSON_HEDLEY_VERSION -#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MAJOR -#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_MINOR -#undef NLOHMANN_JSON_HEDLEY_VERSION_DECODE_REVISION -#undef NLOHMANN_JSON_HEDLEY_VERSION_ENCODE -#undef NLOHMANN_JSON_HEDLEY_WARNING -#undef NLOHMANN_JSON_HEDLEY_WARN_UNUSED_RESULT +#undef JSON_HEDLEY_ALWAYS_INLINE +#undef JSON_HEDLEY_ARM_VERSION +#undef JSON_HEDLEY_ARM_VERSION_CHECK +#undef JSON_HEDLEY_ARRAY_PARAM +#undef JSON_HEDLEY_ASSUME +#undef JSON_HEDLEY_BEGIN_C_DECLS +#undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#undef JSON_HEDLEY_CLANG_HAS_FEATURE +#undef JSON_HEDLEY_CLANG_HAS_WARNING +#undef JSON_HEDLEY_COMPCERT_VERSION +#undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#undef JSON_HEDLEY_CONCAT +#undef JSON_HEDLEY_CONCAT_EX +#undef JSON_HEDLEY_CONST +#undef JSON_HEDLEY_CONSTEXPR +#undef JSON_HEDLEY_CONST_CAST +#undef JSON_HEDLEY_CPP_CAST +#undef JSON_HEDLEY_CRAY_VERSION +#undef JSON_HEDLEY_CRAY_VERSION_CHECK +#undef JSON_HEDLEY_C_DECL +#undef JSON_HEDLEY_DEPRECATED +#undef JSON_HEDLEY_DEPRECATED_FOR +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#undef JSON_HEDLEY_DIAGNOSTIC_POP +#undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#undef JSON_HEDLEY_DMC_VERSION +#undef JSON_HEDLEY_DMC_VERSION_CHECK +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#undef JSON_HEDLEY_END_C_DECLS +#undef JSON_HEDLEY_FALL_THROUGH +#undef JSON_HEDLEY_FLAGS +#undef JSON_HEDLEY_FLAGS_CAST +#undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_BUILTIN +#undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_EXTENSION +#undef JSON_HEDLEY_GCC_HAS_FEATURE +#undef JSON_HEDLEY_GCC_HAS_WARNING +#undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#undef JSON_HEDLEY_GCC_VERSION +#undef JSON_HEDLEY_GCC_VERSION_CHECK +#undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#undef JSON_HEDLEY_GNUC_HAS_FEATURE +#undef JSON_HEDLEY_GNUC_HAS_WARNING +#undef JSON_HEDLEY_GNUC_VERSION +#undef JSON_HEDLEY_GNUC_VERSION_CHECK +#undef JSON_HEDLEY_HAS_ATTRIBUTE +#undef JSON_HEDLEY_HAS_BUILTIN +#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_HAS_EXTENSION +#undef JSON_HEDLEY_HAS_FEATURE +#undef JSON_HEDLEY_HAS_WARNING +#undef JSON_HEDLEY_IAR_VERSION +#undef JSON_HEDLEY_IAR_VERSION_CHECK +#undef JSON_HEDLEY_IBM_VERSION +#undef JSON_HEDLEY_IBM_VERSION_CHECK +#undef JSON_HEDLEY_IMPORT +#undef JSON_HEDLEY_INLINE +#undef JSON_HEDLEY_INTEL_VERSION +#undef JSON_HEDLEY_INTEL_VERSION_CHECK +#undef JSON_HEDLEY_IS_CONSTANT +#undef JSON_HEDLEY_LIKELY +#undef JSON_HEDLEY_MALLOC +#undef JSON_HEDLEY_MESSAGE +#undef JSON_HEDLEY_MSVC_VERSION +#undef JSON_HEDLEY_MSVC_VERSION_CHECK +#undef JSON_HEDLEY_NEVER_INLINE +#undef JSON_HEDLEY_NON_NULL +#undef JSON_HEDLEY_NO_RETURN +#undef JSON_HEDLEY_NO_THROW +#undef JSON_HEDLEY_PELLES_VERSION +#undef JSON_HEDLEY_PELLES_VERSION_CHECK +#undef JSON_HEDLEY_PGI_VERSION +#undef JSON_HEDLEY_PGI_VERSION_CHECK +#undef JSON_HEDLEY_PREDICT +#undef JSON_HEDLEY_PRINTF_FORMAT +#undef JSON_HEDLEY_PRIVATE +#undef JSON_HEDLEY_PUBLIC +#undef JSON_HEDLEY_PURE +#undef JSON_HEDLEY_REINTERPRET_CAST +#undef JSON_HEDLEY_REQUIRE +#undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#undef JSON_HEDLEY_REQUIRE_MSG +#undef JSON_HEDLEY_RESTRICT +#undef JSON_HEDLEY_RETURNS_NON_NULL +#undef JSON_HEDLEY_SENTINEL +#undef JSON_HEDLEY_STATIC_ASSERT +#undef JSON_HEDLEY_STATIC_CAST +#undef JSON_HEDLEY_STRINGIFY +#undef JSON_HEDLEY_STRINGIFY_EX +#undef JSON_HEDLEY_SUNPRO_VERSION +#undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#undef JSON_HEDLEY_TINYC_VERSION +#undef JSON_HEDLEY_TINYC_VERSION_CHECK +#undef JSON_HEDLEY_TI_VERSION +#undef JSON_HEDLEY_TI_VERSION_CHECK +#undef JSON_HEDLEY_UNAVAILABLE +#undef JSON_HEDLEY_UNLIKELY +#undef JSON_HEDLEY_UNPREDICTABLE +#undef JSON_HEDLEY_UNREACHABLE +#undef JSON_HEDLEY_UNREACHABLE_RETURN +#undef JSON_HEDLEY_VERSION +#undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#undef JSON_HEDLEY_VERSION_DECODE_MINOR +#undef JSON_HEDLEY_VERSION_DECODE_REVISION +#undef JSON_HEDLEY_VERSION_ENCODE +#undef JSON_HEDLEY_WARNING +#undef JSON_HEDLEY_WARN_UNUSED_RESULT From 346e9813c524fe79b3819d6cf8dcbd92be785452 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 2 Jul 2019 20:25:51 +0200 Subject: [PATCH 5/7] :construction: add more annotations --- README.md | 3 +++ include/nlohmann/detail/input/lexer.hpp | 5 +++++ single_include/nlohmann/json.hpp | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 9ebd0789..071770c8 100644 --- a/README.md +++ b/README.md @@ -1076,6 +1076,8 @@ The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed und The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the [MIT License](http://opensource.org/licenses/MIT) (see above). Copyright © 2009 [Florian Loitsch](http://florian.loitsch.com/) +The class contains a copy of [Hedley](https://nemequ.github.io/hedley/) from Evan Nemerson which is licensed as [CC0-1.0](http://creativecommons.org/publicdomain/zero/1.0/). + ## Contact If you have questions regarding the library, I would like to invite you to [open an issue at GitHub](https://github.com/nlohmann/json/issues/new/choose). Please describe your request, problem, or question as detailed as possible, and also mention the version of the library you are using as well as the version of your compiler and operating system. Opening an issue at GitHub allows other users and contributors to this library to collaborate. For instance, I have little experience with MSVC, and most issues in this regard have been solved by a growing community. If you have a look at the [closed issues](https://github.com/nlohmann/json/issues?q=is%3Aissue+is%3Aclosed), you will see that we react quite timely in most cases. @@ -1285,6 +1287,7 @@ The library itself consists of a single header file licensed under the MIT licen - [**git-update-ghpages**](https://github.com/rstacruz/git-update-ghpages) to upload the documentation to gh-pages - [**GitHub Changelog Generator**](https://github.com/skywinder/github-changelog-generator) to generate the [ChangeLog](https://github.com/nlohmann/json/blob/develop/ChangeLog.md) - [**Google Benchmark**](https://github.com/google/benchmark) to implement the benchmarks +- [**Hedley**](https://nemequ.github.io/hedley/) to avoid re-inventing several compiler-agnostic feature macros - [**lcov**](http://ltp.sourceforge.net/coverage/lcov.php) to process coverage information and create a HTML view - [**libFuzzer**](http://llvm.org/docs/LibFuzzer.html) to implement fuzz testing for OSS-Fuzz - [**OSS-Fuzz**](https://github.com/google/oss-fuzz) for continuous fuzz testing of the library ([project repository](https://github.com/google/oss-fuzz/tree/master/projects/json)) diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index d19836cb..35e4e5d0 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -60,6 +60,7 @@ class lexer /// return name of values of type token_type (only used for errors) JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_CONST static const char* token_type_name(const token_type t) noexcept { switch (t) @@ -119,6 +120,7 @@ class lexer ///////////////////// /// return the locale-dependent decimal point + JSON_HEDLEY_PURE static char get_decimal_point() noexcept { const auto loc = localeconv(); @@ -817,18 +819,21 @@ class lexer } JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_CONST static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_CONST static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_CONST static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index e2704b9f..8eab28c2 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -7083,6 +7083,7 @@ class lexer /// return name of values of type token_type (only used for errors) JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_CONST static const char* token_type_name(const token_type t) noexcept { switch (t) @@ -7142,6 +7143,7 @@ class lexer ///////////////////// /// return the locale-dependent decimal point + JSON_HEDLEY_PURE static char get_decimal_point() noexcept { const auto loc = localeconv(); @@ -7840,18 +7842,21 @@ class lexer } JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_CONST static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_CONST static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } JSON_HEDLEY_NON_NULL(2) + JSON_HEDLEY_CONST static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); From 947656544d133d9da7fb8b02d52e25d670ff050f Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 2 Jul 2019 21:06:42 +0200 Subject: [PATCH 6/7] :rotating_light: fix warnings --- include/nlohmann/detail/input/lexer.hpp | 3 - .../nlohmann/detail/output/binary_writer.hpp | 6 +- single_include/nlohmann/json.hpp | 9 +- test/src/unit-bson.cpp | 30 ++-- test/src/unit-cbor.cpp | 134 ++++++++-------- test/src/unit-class_parser.cpp | 32 ++-- test/src/unit-constructor1.cpp | 5 +- test/src/unit-deserialization.cpp | 51 +++--- test/src/unit-msgpack.cpp | 104 +++++++------ test/src/unit-regression.cpp | 117 ++++++++------ test/src/unit-testsuites.cpp | 38 +++-- test/src/unit-ubjson.cpp | 147 ++++++++++-------- test/src/unit-unicode.cpp | 50 +++--- test/src/unit-wstring.cpp | 9 +- 14 files changed, 406 insertions(+), 329 deletions(-) diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index 35e4e5d0..0843d749 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -819,21 +819,18 @@ class lexer } JSON_HEDLEY_NON_NULL(2) - JSON_HEDLEY_CONST static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } JSON_HEDLEY_NON_NULL(2) - JSON_HEDLEY_CONST static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } JSON_HEDLEY_NON_NULL(2) - JSON_HEDLEY_CONST static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); diff --git a/include/nlohmann/detail/output/binary_writer.hpp b/include/nlohmann/detail/output/binary_writer.hpp index b0ab62d1..306f969b 100644 --- a/include/nlohmann/detail/output/binary_writer.hpp +++ b/include/nlohmann/detail/output/binary_writer.hpp @@ -1205,7 +1205,7 @@ class binary_writer case value_t::number_unsigned: { - if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) { return 'i'; } @@ -1213,11 +1213,11 @@ class binary_writer { return 'U'; } - if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) { return 'I'; } - if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) { return 'l'; } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 8eab28c2..6d32ff44 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -7842,21 +7842,18 @@ class lexer } JSON_HEDLEY_NON_NULL(2) - JSON_HEDLEY_CONST static void strtof(float& f, const char* str, char** endptr) noexcept { f = std::strtof(str, endptr); } JSON_HEDLEY_NON_NULL(2) - JSON_HEDLEY_CONST static void strtof(double& f, const char* str, char** endptr) noexcept { f = std::strtod(str, endptr); } JSON_HEDLEY_NON_NULL(2) - JSON_HEDLEY_CONST static void strtof(long double& f, const char* str, char** endptr) noexcept { f = std::strtold(str, endptr); @@ -12316,7 +12313,7 @@ class binary_writer case value_t::number_unsigned: { - if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) { return 'i'; } @@ -12324,11 +12321,11 @@ class binary_writer { return 'U'; } - if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) { return 'I'; } - if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) { return 'l'; } diff --git a/test/src/unit-bson.cpp b/test/src/unit-bson.cpp index 2689dcec..cc4b5a65 100644 --- a/test/src/unit-bson.cpp +++ b/test/src/unit-bson.cpp @@ -112,8 +112,9 @@ TEST_CASE("BSON") 0x00, 0x00, 0x00, 0x00, 0x80 }; - CHECK_THROWS_AS(json::from_bson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_bson(v), "[json.exception.parse_error.112] parse error at byte 10: syntax error while parsing BSON string: string length must be at least 1, is -2147483648"); + json _; + CHECK_THROWS_AS(_ = json::from_bson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_bson(v), "[json.exception.parse_error.112] parse error at byte 10: syntax error while parsing BSON string: string length must be at least 1, is -2147483648"); } SECTION("objects") @@ -692,8 +693,9 @@ TEST_CASE("Incomplete BSON Input") 'e', 'n', 't' // unexpected EOF }; - CHECK_THROWS_AS(json::from_bson(incomplete_bson), json::parse_error&); - CHECK_THROWS_WITH(json::from_bson(incomplete_bson), + json _; + CHECK_THROWS_AS(_ = json::from_bson(incomplete_bson), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_bson(incomplete_bson), "[json.exception.parse_error.110] parse error at byte 9: syntax error while parsing BSON cstring: unexpected end of input"); CHECK(json::from_bson(incomplete_bson, true, false).is_discarded()); @@ -710,8 +712,9 @@ TEST_CASE("Incomplete BSON Input") 0x08, // entry: boolean, unexpected EOF }; - CHECK_THROWS_AS(json::from_bson(incomplete_bson), json::parse_error&); - CHECK_THROWS_WITH(json::from_bson(incomplete_bson), + json _; + CHECK_THROWS_AS(_ = json::from_bson(incomplete_bson), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_bson(incomplete_bson), "[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing BSON cstring: unexpected end of input"); CHECK(json::from_bson(incomplete_bson, true, false).is_discarded()); @@ -733,8 +736,9 @@ TEST_CASE("Incomplete BSON Input") // missing input data... }; - CHECK_THROWS_AS(json::from_bson(incomplete_bson), json::parse_error&); - CHECK_THROWS_WITH(json::from_bson(incomplete_bson), + json _; + CHECK_THROWS_AS(_ = json::from_bson(incomplete_bson), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_bson(incomplete_bson), "[json.exception.parse_error.110] parse error at byte 28: syntax error while parsing BSON element list: unexpected end of input"); CHECK(json::from_bson(incomplete_bson, true, false).is_discarded()); @@ -749,8 +753,9 @@ TEST_CASE("Incomplete BSON Input") 0x0D, 0x00, // size (incomplete), unexpected EOF }; - CHECK_THROWS_AS(json::from_bson(incomplete_bson), json::parse_error&); - CHECK_THROWS_WITH(json::from_bson(incomplete_bson), + json _; + CHECK_THROWS_AS(_ = json::from_bson(incomplete_bson), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_bson(incomplete_bson), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing BSON number: unexpected end of input"); CHECK(json::from_bson(incomplete_bson, true, false).is_discarded()); @@ -791,8 +796,9 @@ TEST_CASE("Unsupported BSON input") 0x00 // end marker }; - CHECK_THROWS_AS(json::from_bson(bson), json::parse_error&); - CHECK_THROWS_WITH(json::from_bson(bson), + json _; + CHECK_THROWS_AS(_ = json::from_bson(bson), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_bson(bson), "[json.exception.parse_error.114] parse error at byte 5: Unsupported BSON record type 0xFF"); CHECK(json::from_bson(bson, true, false).is_discarded()); diff --git a/test/src/unit-cbor.cpp b/test/src/unit-cbor.cpp index 69368b41..8b4a1707 100644 --- a/test/src/unit-cbor.cpp +++ b/test/src/unit-cbor.cpp @@ -836,15 +836,17 @@ TEST_CASE("CBOR") { SECTION("no byte follows") { - CHECK_THROWS_AS(json::from_cbor(std::vector({0xf9})), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0xf9})), + json _; + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0xf9})), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0xf9})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input"); CHECK(json::from_cbor(std::vector({0xf9}), true, false).is_discarded()); } SECTION("only one byte follows") { - CHECK_THROWS_AS(json::from_cbor(std::vector({0xf9, 0x7c})), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0xf9, 0x7c})), + json _; + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0xf9, 0x7c})), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0xf9, 0x7c})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input"); CHECK(json::from_cbor(std::vector({0xf9, 0x7c}), true, false).is_discarded()); } @@ -1319,86 +1321,88 @@ TEST_CASE("CBOR") { SECTION("empty byte vector") { - CHECK_THROWS_AS(json::from_cbor(std::vector()), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(std::vector()), + json _; + CHECK_THROWS_AS(_ = json::from_cbor(std::vector()), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector()), "[json.exception.parse_error.110] parse error at byte 1: syntax error while parsing CBOR value: unexpected end of input"); CHECK(json::from_cbor(std::vector(), true, false).is_discarded()); } SECTION("too short byte vector") { - CHECK_THROWS_AS(json::from_cbor(std::vector({0x18})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x19})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x19, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1a})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1a, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1a, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1a, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1b})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1b, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1b, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x62})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x62, 0x60})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x7F})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x7F, 0x60})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x82, 0x01})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0x9F, 0x01})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0xBF, 0x61, 0x61, 0xF5})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0xA1, 0x61, 0X61})), json::parse_error&); - CHECK_THROWS_AS(json::from_cbor(std::vector({0xBF, 0x61, 0X61})), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x18})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x19})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x19, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1a})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1a, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1a, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1a, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1b})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1b, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x62})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x62, 0x60})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x7F})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x7F, 0x60})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x82, 0x01})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x9F, 0x01})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0xBF, 0x61, 0x61, 0xF5})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0xA1, 0x61, 0X61})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0xBF, 0x61, 0X61})), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x18})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x18})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x19})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x19})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x19, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x19, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1a})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1a})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1a, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1a, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1a, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1a, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1a, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1a, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1b})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1b})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1b, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1b, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1b, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 9: syntax error while parsing CBOR number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x62})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x62})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR string: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x62, 0x60})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x62, 0x60})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR string: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x7F})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x7F})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR string: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x7F, 0x60})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x7F, 0x60})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR string: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x82, 0x01})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x82, 0x01})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR value: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x9F, 0x01})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x9F, 0x01})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR value: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0xBF, 0x61, 0x61, 0xF5})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0xBF, 0x61, 0x61, 0xF5})), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR string: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0xA1, 0x61, 0x61})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0xA1, 0x61, 0x61})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR value: unexpected end of input"); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0xBF, 0x61, 0x61})), + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0xBF, 0x61, 0x61})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR value: unexpected end of input"); CHECK(json::from_cbor(std::vector({0x18}), true, false).is_discarded()); @@ -1431,13 +1435,14 @@ TEST_CASE("CBOR") { SECTION("concrete examples") { - CHECK_THROWS_AS(json::from_cbor(std::vector({0x1c})), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0x1c})), + json _; + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0x1c})), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0x1c})), "[json.exception.parse_error.112] parse error at byte 1: syntax error while parsing CBOR value: invalid byte: 0x1C"); CHECK(json::from_cbor(std::vector({0x1c}), true, false).is_discarded()); - CHECK_THROWS_AS(json::from_cbor(std::vector({0xf8})), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0xf8})), + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0xf8})), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0xf8})), "[json.exception.parse_error.112] parse error at byte 1: syntax error while parsing CBOR value: invalid byte: 0xF8"); CHECK(json::from_cbor(std::vector({0xf8}), true, false).is_discarded()); } @@ -1488,7 +1493,8 @@ TEST_CASE("CBOR") 0xf8 }) { - CHECK_THROWS_AS(json::from_cbor(std::vector({static_cast(byte)})), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({static_cast(byte)})), json::parse_error&); CHECK(json::from_cbor(std::vector({static_cast(byte)}), true, false).is_discarded()); } } @@ -1496,8 +1502,9 @@ TEST_CASE("CBOR") SECTION("invalid string in map") { - CHECK_THROWS_AS(json::from_cbor(std::vector({0xa1, 0xff, 0x01})), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(std::vector({0xa1, 0xff, 0x01})), + json _; + CHECK_THROWS_AS(_ = json::from_cbor(std::vector({0xa1, 0xff, 0x01})), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(std::vector({0xa1, 0xff, 0x01})), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0xFF"); CHECK(json::from_cbor(std::vector({0xa1, 0xff, 0x01}), true, false).is_discarded()); } @@ -1514,8 +1521,9 @@ TEST_CASE("CBOR") SECTION("strict mode") { - CHECK_THROWS_AS(json::from_cbor(vec), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec), + json _; + CHECK_THROWS_AS(_ = json::from_cbor(vec), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR value: expected end of input; last byte: 0xF6"); CHECK(json::from_cbor(vec, true, false).is_discarded()); } diff --git a/test/src/unit-class_parser.cpp b/test/src/unit-class_parser.cpp index edbef499..fa09c565 100644 --- a/test/src/unit-class_parser.cpp +++ b/test/src/unit-class_parser.cpp @@ -406,8 +406,9 @@ TEST_CASE("parser class") // uses an iterator range. std::string s = "\"1\""; s[1] = '\0'; - CHECK_THROWS_AS(json::parse(s.begin(), s.end()), json::parse_error&); - CHECK_THROWS_WITH(json::parse(s.begin(), s.end()), "[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid string: control character U+0000 (NUL) must be escaped to \\u0000; last read: '\"'"); + json _; + CHECK_THROWS_AS(_ = json::parse(s.begin(), s.end()), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(s.begin(), s.end()), "[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid string: control character U+0000 (NUL) must be escaped to \\u0000; last read: '\"'"); } } @@ -1219,19 +1220,21 @@ TEST_CASE("parser class") } } + json _; + // missing part of a surrogate pair - CHECK_THROWS_AS(json::parse("\"\\uD80C\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uD80C\""), + CHECK_THROWS_AS(_ = json::parse("\"\\uD80C\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uD80C\""), "[json.exception.parse_error.101] parse error at line 1, column 8: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD80C\"'"); // invalid surrogate pair - CHECK_THROWS_AS(json::parse("\"\\uD80C\\uD80C\""), json::parse_error&); - CHECK_THROWS_AS(json::parse("\"\\uD80C\\u0000\""), json::parse_error&); - CHECK_THROWS_AS(json::parse("\"\\uD80C\\uFFFF\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uD80C\\uD80C\""), + CHECK_THROWS_AS(_ = json::parse("\"\\uD80C\\uD80C\""), json::parse_error&); + CHECK_THROWS_AS(_ = json::parse("\"\\uD80C\\u0000\""), json::parse_error&); + CHECK_THROWS_AS(_ = json::parse("\"\\uD80C\\uFFFF\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uD80C\\uD80C\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD80C\\uD80C'"); - CHECK_THROWS_WITH(json::parse("\"\\uD80C\\u0000\""), + CHECK_THROWS_WITH(_ = json::parse("\"\\uD80C\\u0000\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD80C\\u0000'"); - CHECK_THROWS_WITH(json::parse("\"\\uD80C\\uFFFF\""), + CHECK_THROWS_WITH(_ = json::parse("\"\\uD80C\\uFFFF\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD80C\\uFFFF'"); } @@ -1679,12 +1682,13 @@ TEST_CASE("parser class") CHECK(json::parse("{\"foo\": true:", cb, false).is_discarded()); - CHECK_THROWS_AS(json::parse("{\"foo\": true:", cb), json::parse_error&); - CHECK_THROWS_WITH(json::parse("{\"foo\": true:", cb), + json _; + CHECK_THROWS_AS(_ = json::parse("{\"foo\": true:", cb), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("{\"foo\": true:", cb), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing object - unexpected ':'; expected '}'"); - CHECK_THROWS_AS(json::parse("1.18973e+4932", cb), json::out_of_range&); - CHECK_THROWS_WITH(json::parse("1.18973e+4932", cb), + CHECK_THROWS_AS(_ = json::parse("1.18973e+4932", cb), json::out_of_range&); + CHECK_THROWS_WITH(_ = json::parse("1.18973e+4932", cb), "[json.exception.out_of_range.406] number overflow parsing '1.18973e+4932'"); } diff --git a/test/src/unit-constructor1.cpp b/test/src/unit-constructor1.cpp index f7b6c775..93528d37 100644 --- a/test/src/unit-constructor1.cpp +++ b/test/src/unit-constructor1.cpp @@ -1052,9 +1052,10 @@ TEST_CASE("constructors") SECTION("object with error") { - CHECK_THROWS_AS(json::object({ {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false}, 13 }), + json _; + CHECK_THROWS_AS(_ = json::object({ {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false}, 13 }), json::type_error&); - CHECK_THROWS_WITH(json::object({ {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false}, 13 }), + CHECK_THROWS_WITH(_ = json::object({ {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false}, 13 }), "[json.exception.type_error.301] cannot create object from initializer list"); } diff --git a/test/src/unit-deserialization.cpp b/test/src/unit-deserialization.cpp index 10bece66..f49f1025 100644 --- a/test/src/unit-deserialization.cpp +++ b/test/src/unit-deserialization.cpp @@ -269,8 +269,10 @@ TEST_CASE("deserialization") ss3 << "[\"foo\",1,2,3,false,{\"one\":1}"; ss4 << "[\"foo\",1,2,3,false,{\"one\":1}"; ss5 << "[\"foo\",1,2,3,false,{\"one\":1}"; - CHECK_THROWS_AS(json::parse(ss1), json::parse_error&); - CHECK_THROWS_WITH(json::parse(ss2), + + json _; + CHECK_THROWS_AS(_ = json::parse(ss1), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(ss2), "[json.exception.parse_error.101] parse error at line 1, column 29: syntax error while parsing array - unexpected end of input; expected ']'"); CHECK(not json::accept(ss3)); @@ -293,8 +295,9 @@ TEST_CASE("deserialization") SECTION("string") { json::string_t s = "[\"foo\",1,2,3,false,{\"one\":1}"; - CHECK_THROWS_AS(json::parse(s), json::parse_error&); - CHECK_THROWS_WITH(json::parse(s), + json _; + CHECK_THROWS_AS(_ = json::parse(s), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(s), "[json.exception.parse_error.101] parse error at line 1, column 29: syntax error while parsing array - unexpected end of input; expected ']'"); CHECK(not json::accept(s)); @@ -430,7 +433,8 @@ TEST_CASE("deserialization") SECTION("empty container") { std::vector v; - CHECK_THROWS_AS(json::parse(v), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(v), json::parse_error&); CHECK(not json::accept(v)); SaxEventLogger l; @@ -614,8 +618,9 @@ TEST_CASE("deserialization") SECTION("case 6") { uint8_t v[] = {'\"', 0x7F, 0xDF, 0x7F}; - CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), json::parse_error&); - CHECK_THROWS_WITH(json::parse(std::begin(v), std::end(v)), + json _; + CHECK_THROWS_AS(_ = json::parse(std::begin(v), std::end(v)), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(std::begin(v), std::end(v)), "[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value - invalid string: ill-formed UTF-8 byte; last read: '\"\x7f\xdf\x7f'"); CHECK(not json::accept(std::begin(v), std::end(v))); @@ -801,12 +806,13 @@ TEST_CASE("deserialization") SECTION("BOM only") { - CHECK_THROWS_AS(json::parse(bom), json::parse_error&); - CHECK_THROWS_WITH(json::parse(bom), + json _; + CHECK_THROWS_AS(_ = json::parse(bom), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(bom), "[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal"); - CHECK_THROWS_AS(json::parse(std::istringstream(bom)), json::parse_error&); - CHECK_THROWS_WITH(json::parse(std::istringstream(bom)), + CHECK_THROWS_AS(_ = json::parse(std::istringstream(bom)), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(std::istringstream(bom)), "[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal"); SaxEventLogger l; @@ -840,12 +846,13 @@ TEST_CASE("deserialization") SECTION("2 byte of BOM") { - CHECK_THROWS_AS(json::parse(bom.substr(0, 2)), json::parse_error&); - CHECK_THROWS_WITH(json::parse(bom.substr(0, 2)), + json _; + CHECK_THROWS_AS(_ = json::parse(bom.substr(0, 2)), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(bom.substr(0, 2)), "[json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value - invalid BOM; must be 0xEF 0xBB 0xBF if given; last read: '\xEF\xBB'"); - CHECK_THROWS_AS(json::parse(std::istringstream(bom.substr(0, 2))), json::parse_error&); - CHECK_THROWS_WITH(json::parse(std::istringstream(bom.substr(0, 2))), + CHECK_THROWS_AS(_ = json::parse(std::istringstream(bom.substr(0, 2))), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(std::istringstream(bom.substr(0, 2))), "[json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value - invalid BOM; must be 0xEF 0xBB 0xBF if given; last read: '\xEF\xBB'"); SaxEventLogger l1, l2; @@ -865,12 +872,13 @@ TEST_CASE("deserialization") SECTION("1 byte of BOM") { - CHECK_THROWS_AS(json::parse(bom.substr(0, 1)), json::parse_error&); - CHECK_THROWS_WITH(json::parse(bom.substr(0, 1)), + json _; + CHECK_THROWS_AS(_ = json::parse(bom.substr(0, 1)), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(bom.substr(0, 1)), "[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid BOM; must be 0xEF 0xBB 0xBF if given; last read: '\xEF'"); - CHECK_THROWS_AS(json::parse(std::istringstream(bom.substr(0, 1))), json::parse_error&); - CHECK_THROWS_WITH(json::parse(std::istringstream(bom.substr(0, 1))), + CHECK_THROWS_AS(_ = json::parse(std::istringstream(bom.substr(0, 1))), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(std::istringstream(bom.substr(0, 1))), "[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid BOM; must be 0xEF 0xBB 0xBF if given; last read: '\xEF'"); SaxEventLogger l1, l2; @@ -925,8 +933,9 @@ TEST_CASE("deserialization") else { // any variation is an error - CHECK_THROWS_AS(json::parse(s + "null"), json::parse_error&); - CHECK_THROWS_AS(json::parse(std::istringstream(s + "null")), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(s + "null"), json::parse_error&); + CHECK_THROWS_AS(_ = json::parse(std::istringstream(s + "null")), json::parse_error&); SaxEventLogger l; CHECK(not json::sax_parse(s + "null", &l)); diff --git a/test/src/unit-msgpack.cpp b/test/src/unit-msgpack.cpp index cc1b8ae3..7a095544 100644 --- a/test/src/unit-msgpack.cpp +++ b/test/src/unit-msgpack.cpp @@ -1128,71 +1128,73 @@ TEST_CASE("MessagePack") { SECTION("empty byte vector") { - CHECK_THROWS_AS(json::from_msgpack(std::vector()), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(std::vector()), + json _; + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector()), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector()), "[json.exception.parse_error.110] parse error at byte 1: syntax error while parsing MessagePack value: unexpected end of input"); CHECK(json::from_msgpack(std::vector(), true, false).is_discarded()); } SECTION("too short byte vector") { - CHECK_THROWS_AS(json::from_msgpack(std::vector({0x87})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcc})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcd})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcd, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xce})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xce, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xce, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xce, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcf})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcf, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcf, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xa5, 0x68, 0x65})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0x92, 0x01})), json::parse_error&); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0x81, 0xa1, 0x61})), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0x87})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcc})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcd})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcd, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xce})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xce, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xce, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xce, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcf})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcf, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xa5, 0x68, 0x65})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0x92, 0x01})), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0x81, 0xa1, 0x61})), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0x87})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0x87})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing MessagePack string: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcc})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcc})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcd})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcd})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcd, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcd, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xce})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xce})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xce, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xce, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xce, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xce, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xce, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xce, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcf})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcf})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcf, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcf, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcf, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 9: syntax error while parsing MessagePack number: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xa5, 0x68, 0x65})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xa5, 0x68, 0x65})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing MessagePack string: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0x92, 0x01})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0x92, 0x01})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing MessagePack value: unexpected end of input"); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0x81, 0xa1, 0x61})), + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0x81, 0xa1, 0x61})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing MessagePack value: unexpected end of input"); CHECK(json::from_msgpack(std::vector({0x87}), true, false).is_discarded()); @@ -1220,13 +1222,14 @@ TEST_CASE("MessagePack") { SECTION("concrete examples") { - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xc1})), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xc1})), + json _; + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xc1})), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xc1})), "[json.exception.parse_error.112] parse error at byte 1: syntax error while parsing MessagePack value: invalid byte: 0xC1"); CHECK(json::from_msgpack(std::vector({0xc6}), true, false).is_discarded()); - CHECK_THROWS_AS(json::from_msgpack(std::vector({0xc6})), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0xc6})), + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0xc6})), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0xc6})), "[json.exception.parse_error.112] parse error at byte 1: syntax error while parsing MessagePack value: invalid byte: 0xC6"); CHECK(json::from_msgpack(std::vector({0xc6}), true, false).is_discarded()); } @@ -1245,7 +1248,8 @@ TEST_CASE("MessagePack") 0xd4, 0xd5, 0xd6, 0xd7, 0xd8 }) { - CHECK_THROWS_AS(json::from_msgpack(std::vector({static_cast(byte)})), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({static_cast(byte)})), json::parse_error&); CHECK(json::from_msgpack(std::vector({static_cast(byte)}), true, false).is_discarded()); } } @@ -1253,8 +1257,9 @@ TEST_CASE("MessagePack") SECTION("invalid string in map") { - CHECK_THROWS_AS(json::from_msgpack(std::vector({0x81, 0xff, 0x01})), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(std::vector({0x81, 0xff, 0x01})), + json _; + CHECK_THROWS_AS(_ = json::from_msgpack(std::vector({0x81, 0xff, 0x01})), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(std::vector({0x81, 0xff, 0x01})), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing MessagePack string: expected length specification (0xA0-0xBF, 0xD9-0xDB); last byte: 0xFF"); CHECK(json::from_msgpack(std::vector({0x81, 0xff, 0x01}), true, false).is_discarded()); } @@ -1270,8 +1275,9 @@ TEST_CASE("MessagePack") SECTION("strict mode") { - CHECK_THROWS_AS(json::from_msgpack(vec), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(vec), + json _; + CHECK_THROWS_AS(_ = json::from_msgpack(vec), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(vec), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing MessagePack value: expected end of input; last byte: 0xC0"); CHECK(json::from_msgpack(vec, true, false).is_discarded()); } diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp index 88b12114..2bac06b8 100644 --- a/test/src/unit-regression.cpp +++ b/test/src/unit-regression.cpp @@ -696,8 +696,9 @@ TEST_CASE("regression tests") SECTION("issue #329 - serialized value not always can be parsed") { - CHECK_THROWS_AS(json::parse("22e2222"), json::out_of_range&); - CHECK_THROWS_WITH(json::parse("22e2222"), + json _; + CHECK_THROWS_AS(_ = json::parse("22e2222"), json::out_of_range&); + CHECK_THROWS_WITH(_ = json::parse("22e2222"), "[json.exception.out_of_range.406] number overflow parsing '22e2222'"); } @@ -762,8 +763,9 @@ TEST_CASE("regression tests") SECTION("issue #366 - json::parse on failed stream gets stuck") { std::ifstream f("file_not_found.json"); - CHECK_THROWS_AS(json::parse(f), json::parse_error&); - CHECK_THROWS_WITH(json::parse(f), "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal"); + json _; + CHECK_THROWS_AS(_ = json::parse(f), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse(f), "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal"); } SECTION("issue #367 - calling stream at EOF") @@ -958,50 +960,55 @@ TEST_CASE("regression tests") { // original test case std::vector vec {0x65, 0xf5, 0x0a, 0x48, 0x21}; - CHECK_THROWS_AS(json::from_cbor(vec), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec), + json _; + CHECK_THROWS_AS(_ = json::from_cbor(vec), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec), "[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing CBOR string: unexpected end of input"); } SECTION("issue #407 - Heap-buffer-overflow (OSS-Fuzz issue 343)") { + json _; + // original test case: incomplete float64 std::vector vec1 {0xcb, 0x8f, 0x0a}; - CHECK_THROWS_AS(json::from_msgpack(vec1), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(vec1), + CHECK_THROWS_AS(_ = json::from_msgpack(vec1), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(vec1), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing MessagePack number: unexpected end of input"); // related test case: incomplete float32 std::vector vec2 {0xca, 0x8f, 0x0a}; - CHECK_THROWS_AS(json::from_msgpack(vec2), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(vec2), + CHECK_THROWS_AS(_ = json::from_msgpack(vec2), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(vec2), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing MessagePack number: unexpected end of input"); // related test case: incomplete Half-Precision Float (CBOR) std::vector vec3 {0xf9, 0x8f}; - CHECK_THROWS_AS(json::from_cbor(vec3), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec3), + CHECK_THROWS_AS(_ = json::from_cbor(vec3), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec3), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input"); // related test case: incomplete Single-Precision Float (CBOR) std::vector vec4 {0xfa, 0x8f, 0x0a}; - CHECK_THROWS_AS(json::from_cbor(vec4), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec4), + CHECK_THROWS_AS(_ = json::from_cbor(vec4), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec4), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR number: unexpected end of input"); // related test case: incomplete Double-Precision Float (CBOR) std::vector vec5 {0xfb, 0x8f, 0x0a}; - CHECK_THROWS_AS(json::from_cbor(vec5), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec5), + CHECK_THROWS_AS(_ = json::from_cbor(vec5), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec5), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR number: unexpected end of input"); } SECTION("issue #408 - Heap-buffer-overflow (OSS-Fuzz issue 344)") { + json _; + // original test case std::vector vec1 {0x87}; - CHECK_THROWS_AS(json::from_msgpack(vec1), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(vec1), + CHECK_THROWS_AS(_ = json::from_msgpack(vec1), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(vec1), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing MessagePack string: unexpected end of input"); // more test cases for MessagePack @@ -1014,7 +1021,7 @@ TEST_CASE("regression tests") }) { std::vector vec(1, static_cast(b)); - CHECK_THROWS_AS(json::from_msgpack(vec), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_msgpack(vec), json::parse_error&); } // more test cases for CBOR @@ -1029,37 +1036,39 @@ TEST_CASE("regression tests") }) { std::vector vec(1, static_cast(b)); - CHECK_THROWS_AS(json::from_cbor(vec), json::parse_error&); + CHECK_THROWS_AS(_ = json::from_cbor(vec), json::parse_error&); } // special case: empty input std::vector vec2; - CHECK_THROWS_AS(json::from_cbor(vec2), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec2), + CHECK_THROWS_AS(_ = json::from_cbor(vec2), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec2), "[json.exception.parse_error.110] parse error at byte 1: syntax error while parsing CBOR value: unexpected end of input"); - CHECK_THROWS_AS(json::from_msgpack(vec2), json::parse_error&); - CHECK_THROWS_WITH(json::from_msgpack(vec2), + CHECK_THROWS_AS(_ = json::from_msgpack(vec2), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_msgpack(vec2), "[json.exception.parse_error.110] parse error at byte 1: syntax error while parsing MessagePack value: unexpected end of input"); } SECTION("issue #411 - Heap-buffer-overflow (OSS-Fuzz issue 366)") { + json _; + // original test case: empty UTF-8 string (indefinite length) std::vector vec1 {0x7f}; - CHECK_THROWS_AS(json::from_cbor(vec1), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec1), + CHECK_THROWS_AS(_ = json::from_cbor(vec1), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec1), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR string: unexpected end of input"); // related test case: empty array (indefinite length) std::vector vec2 {0x9f}; - CHECK_THROWS_AS(json::from_cbor(vec2), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec2), + CHECK_THROWS_AS(_ = json::from_cbor(vec2), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec2), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR value: unexpected end of input"); // related test case: empty map (indefinite length) std::vector vec3 {0xbf}; - CHECK_THROWS_AS(json::from_cbor(vec3), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec3), + CHECK_THROWS_AS(_ = json::from_cbor(vec3), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec3), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR string: unexpected end of input"); } @@ -1086,26 +1095,28 @@ TEST_CASE("regression tests") 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }; - CHECK_THROWS_AS(json::from_cbor(vec), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec), + + json _; + CHECK_THROWS_AS(_ = json::from_cbor(vec), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x98"); // related test case: nonempty UTF-8 string (indefinite length) std::vector vec1 {0x7f, 0x61, 0x61}; - CHECK_THROWS_AS(json::from_cbor(vec1), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec1), + CHECK_THROWS_AS(_ = json::from_cbor(vec1), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec1), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR string: unexpected end of input"); // related test case: nonempty array (indefinite length) std::vector vec2 {0x9f, 0x01}; - CHECK_THROWS_AS(json::from_cbor(vec2), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec2), + CHECK_THROWS_AS(_ = json::from_cbor(vec2), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec2), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR value: unexpected end of input"); // related test case: nonempty map (indefinite length) std::vector vec3 {0xbf, 0x61, 0x61, 0x01}; - CHECK_THROWS_AS(json::from_cbor(vec3), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec3), + CHECK_THROWS_AS(_ = json::from_cbor(vec3), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec3), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR string: unexpected end of input"); } @@ -1139,8 +1150,10 @@ TEST_CASE("regression tests") 0x96, 0x96, 0xb4, 0xb4, 0xfa, 0x94, 0x94, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0xfa }; - CHECK_THROWS_AS(json::from_cbor(vec1), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec1), + + json _; + CHECK_THROWS_AS(_ = json::from_cbor(vec1), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec1), "[json.exception.parse_error.113] parse error at byte 13: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0xB4"); // related test case: double-precision @@ -1153,15 +1166,16 @@ TEST_CASE("regression tests") 0x96, 0x96, 0xb4, 0xb4, 0xfa, 0x94, 0x94, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0xfb }; - CHECK_THROWS_AS(json::from_cbor(vec2), json::parse_error&); - CHECK_THROWS_WITH(json::from_cbor(vec2), + CHECK_THROWS_AS(_ = json::from_cbor(vec2), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_cbor(vec2), "[json.exception.parse_error.113] parse error at byte 13: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0xB4"); } SECTION("issue #452 - Heap-buffer-overflow (OSS-Fuzz issue 585)") { std::vector vec = {'-', '0', '1', '2', '2', '7', '4'}; - CHECK_THROWS_AS(json::parse(vec), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(vec), json::parse_error&); } SECTION("issue #454 - doubles are printed as integers") @@ -1309,8 +1323,9 @@ TEST_CASE("regression tests") SECTION("issue #575 - heap-buffer-overflow (OSS-Fuzz 1400)") { + json _; std::vector vec = {'"', '\\', '"', 'X', '"', '"'}; - CHECK_THROWS_AS(json::parse(vec), json::parse_error&); + CHECK_THROWS_AS(_ = json::parse(vec), json::parse_error&); } SECTION("issue #600 - how does one convert a map in Json back to std::map?") @@ -1349,7 +1364,8 @@ TEST_CASE("regression tests") SECTION("issue #602 - BOM not skipped when using json:parse(iterator)") { std::string i = "\xef\xbb\xbf{\n \"foo\": true\n}"; - CHECK_NOTHROW(json::parse(i.begin(), i.end())); + json _; + CHECK_NOTHROW(_ = json::parse(i.begin(), i.end())); } SECTION("issue #702 - conversion from valarray to json fails to build") @@ -1412,7 +1428,8 @@ TEST_CASE("regression tests") ); // handle different exceptions as 'file not found', 'permission denied' is.open("test/data/regression/working_file.json"); - CHECK_NOTHROW(nlohmann::json::parse(is)); + json _; + CHECK_NOTHROW(_ = nlohmann::json::parse(is)); } { @@ -1425,7 +1442,8 @@ TEST_CASE("regression tests") is.open("test/data/json_nlohmann_tests/all_unicode.json.cbor", std::ios_base::in | std::ios_base::binary); - CHECK_NOTHROW(nlohmann::json::from_cbor(is)); + json _; + CHECK_NOTHROW(_ = nlohmann::json::from_cbor(is)); } } @@ -1505,13 +1523,14 @@ TEST_CASE("regression tests") SECTION("issue #962 - Timeout (OSS-Fuzz 6034)") { + json _; std::vector v_ubjson = {'[', '$', 'Z', '#', 'L', 0x78, 0x28, 0x00, 0x68, 0x28, 0x69, 0x69, 0x17}; - CHECK_THROWS_AS(json::from_ubjson(v_ubjson), json::out_of_range&); + CHECK_THROWS_AS(_ = json::from_ubjson(v_ubjson), json::out_of_range&); //CHECK_THROWS_WITH(json::from_ubjson(v_ubjson), // "[json.exception.out_of_range.408] excessive array size: 8658170730974374167"); v_ubjson[0] = '{'; - CHECK_THROWS_AS(json::from_ubjson(v_ubjson), json::out_of_range&); + CHECK_THROWS_AS(_ = json::from_ubjson(v_ubjson), json::out_of_range&); //CHECK_THROWS_WITH(json::from_ubjson(v_ubjson), // "[json.exception.out_of_range.408] excessive object size: 8658170730974374167"); } diff --git a/test/src/unit-testsuites.cpp b/test/src/unit-testsuites.cpp index 6496be10..e65fb88e 100644 --- a/test/src/unit-testsuites.cpp +++ b/test/src/unit-testsuites.cpp @@ -79,7 +79,8 @@ TEST_CASE("compliance tests from json.org") { CAPTURE(filename) std::ifstream f(filename); - CHECK_THROWS_AS(json::parse(f), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(f), json::parse_error&); } } @@ -387,36 +388,36 @@ TEST_CASE("json.org examples") SECTION("FILE 1.json") { std::unique_ptr f(std::fopen("test/data/json.org/1.json", "r"), &std::fclose); - json j; - CHECK_NOTHROW(j.parse(f.get())); + json _; + CHECK_NOTHROW(_ = json::parse(f.get())); } SECTION("FILE 2.json") { std::unique_ptr f(std::fopen("test/data/json.org/2.json", "r"), &std::fclose); - json j; - CHECK_NOTHROW(j.parse(f.get())); + json _; + CHECK_NOTHROW(_ = json::parse(f.get())); } SECTION("FILE 3.json") { std::unique_ptr f(std::fopen("test/data/json.org/3.json", "r"), &std::fclose); - json j; - CHECK_NOTHROW(j.parse(f.get())); + json _; + CHECK_NOTHROW(_ = json::parse(f.get())); } SECTION("FILE 4.json") { std::unique_ptr f(std::fopen("test/data/json.org/4.json", "r"), &std::fclose); - json j; - CHECK_NOTHROW(j.parse(f.get())); + json _; + CHECK_NOTHROW(_ = json::parse(f.get())); } SECTION("FILE 5.json") { std::unique_ptr f(std::fopen("test/data/json.org/5.json", "r"), &std::fclose); - json j; - CHECK_NOTHROW(j.parse(f.get())); + json _; + CHECK_NOTHROW(_ = json::parse(f.get())); } } @@ -810,7 +811,8 @@ TEST_CASE("nst's JSONTestSuite") { CAPTURE(filename) std::ifstream f(filename); - CHECK_THROWS_AS(json::parse(f), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(f), json::parse_error&); } } @@ -1027,7 +1029,8 @@ TEST_CASE("nst's JSONTestSuite (2)") { CAPTURE(filename) std::ifstream f(filename); - CHECK_NOTHROW(json::parse(f)); + json _; + CHECK_NOTHROW(_ = json::parse(f)); std::ifstream f2(filename); CHECK(json::accept(f2)); } @@ -1228,7 +1231,8 @@ TEST_CASE("nst's JSONTestSuite (2)") { CAPTURE(filename) std::ifstream f(filename); - CHECK_THROWS_AS(json::parse(f), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(f), json::parse_error&); std::ifstream f2(filename); CHECK(not json::accept(f2)); } @@ -1293,7 +1297,8 @@ TEST_CASE("nst's JSONTestSuite (2)") { CAPTURE(filename) std::ifstream f(filename); - CHECK_NOTHROW(json::parse(f)); + json _; + CHECK_NOTHROW(_ = json::parse(f)); std::ifstream f2(filename); CHECK(json::accept(f2)); } @@ -1343,7 +1348,8 @@ TEST_CASE("nst's JSONTestSuite (2)") { CAPTURE(filename) std::ifstream f(filename); - CHECK_THROWS_AS(json::parse(f), json::exception&); // could be parse_error or out_of_range + json _; + CHECK_THROWS_AS(_ = json::parse(f), json::exception&); // could be parse_error or out_of_range std::ifstream f2(filename); CHECK(not json::accept(f2)); } diff --git a/test/src/unit-ubjson.cpp b/test/src/unit-ubjson.cpp index ca6b70fd..46539dd6 100644 --- a/test/src/unit-ubjson.cpp +++ b/test/src/unit-ubjson.cpp @@ -1301,8 +1301,9 @@ TEST_CASE("UBJSON") SECTION("strict mode") { - CHECK_THROWS_AS(json::from_ubjson(vec), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vec), + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(vec), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vec), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON value: expected end of input; last byte: 0x5A"); } } @@ -1311,8 +1312,9 @@ TEST_CASE("UBJSON") { // larger than max int64 json j = 9223372036854775808llu; - CHECK_THROWS_AS(json::to_ubjson(j), json::out_of_range&); - CHECK_THROWS_WITH(json::to_ubjson(j), "[json.exception.out_of_range.407] integer number 9223372036854775808 cannot be represented by UBJSON as it does not fit int64"); + json _; + CHECK_THROWS_AS(_ = json::to_ubjson(j), json::out_of_range&); + CHECK_THROWS_WITH(_ = json::to_ubjson(j), "[json.exception.out_of_range.407] integer number 9223372036854775808 cannot be represented by UBJSON as it does not fit int64"); } SECTION("excessive size") @@ -1320,27 +1322,29 @@ TEST_CASE("UBJSON") SECTION("array") { std::vector v_ubjson = {'[', '$', 'Z', '#', 'L', 0x78, 0x28, 0x00, 0x68, 0x28, 0x69, 0x69, 0x17}; - CHECK_THROWS_AS(json::from_ubjson(v_ubjson), json::out_of_range&); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(v_ubjson), json::out_of_range&); json j; nlohmann::detail::json_sax_dom_callback_parser scp(j, [](int, json::parse_event_t, const json&) { return true; }); - CHECK_THROWS_AS(json::sax_parse(v_ubjson, &scp, json::input_format_t::ubjson), json::out_of_range&); + CHECK_THROWS_AS(_ = json::sax_parse(v_ubjson, &scp, json::input_format_t::ubjson), json::out_of_range&); } SECTION("object") { std::vector v_ubjson = {'{', '$', 'Z', '#', 'L', 0x78, 0x28, 0x00, 0x68, 0x28, 0x69, 0x69, 0x17}; - CHECK_THROWS_AS(json::from_ubjson(v_ubjson), json::out_of_range&); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(v_ubjson), json::out_of_range&); json j; nlohmann::detail::json_sax_dom_callback_parser scp(j, [](int, json::parse_event_t, const json&) { return true; }); - CHECK_THROWS_AS(json::sax_parse(v_ubjson, &scp, json::input_format_t::ubjson), json::out_of_range&); + CHECK_THROWS_AS(_ = json::sax_parse(v_ubjson, &scp, json::input_format_t::ubjson), json::out_of_range&); } } } @@ -1531,8 +1535,9 @@ TEST_CASE("UBJSON") { SECTION("empty byte vector") { - CHECK_THROWS_AS(json::from_ubjson(std::vector()), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(std::vector()), + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(std::vector()), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(std::vector()), "[json.exception.parse_error.110] parse error at byte 1: syntax error while parsing UBJSON value: unexpected end of input"); } @@ -1541,15 +1546,17 @@ TEST_CASE("UBJSON") SECTION("eof after C byte") { std::vector v = {'C'}; - CHECK_THROWS_AS(json::from_ubjson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON char: unexpected end of input"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON char: unexpected end of input"); } SECTION("byte out of range") { std::vector v = {'C', 130}; - CHECK_THROWS_AS(json::from_ubjson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing UBJSON char: byte after 'C' must be in range 0x00..0x7F; last byte: 0x82"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing UBJSON char: byte after 'C' must be in range 0x00..0x7F; last byte: 0x82"); } } @@ -1558,15 +1565,17 @@ TEST_CASE("UBJSON") SECTION("eof after S byte") { std::vector v = {'S'}; - CHECK_THROWS_AS(json::from_ubjson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON value: unexpected end of input"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON value: unexpected end of input"); } SECTION("invalid byte") { std::vector v = {'S', '1', 'a'}; - CHECK_THROWS_AS(json::from_ubjson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing UBJSON string: expected length type specification (U, i, I, l, L); last byte: 0x31"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing UBJSON string: expected length type specification (U, i, I, l, L); last byte: 0x31"); } } @@ -1575,138 +1584,144 @@ TEST_CASE("UBJSON") SECTION("optimized array: no size following type") { std::vector v = {'[', '$', 'i', 2}; - CHECK_THROWS_AS(json::from_ubjson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v), "[json.exception.parse_error.112] parse error at byte 4: syntax error while parsing UBJSON size: expected '#' after type information; last byte: 0x02"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v), "[json.exception.parse_error.112] parse error at byte 4: syntax error while parsing UBJSON size: expected '#' after type information; last byte: 0x02"); } } SECTION("strings") { std::vector vS = {'S'}; - CHECK_THROWS_AS(json::from_ubjson(vS), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vS), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON value: unexpected end of input"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(vS), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vS), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(vS, true, false).is_discarded()); std::vector v = {'S', 'i', '2', 'a'}; - CHECK_THROWS_AS(json::from_ubjson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing UBJSON string: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing UBJSON string: unexpected end of input"); CHECK(json::from_ubjson(v, true, false).is_discarded()); std::vector vC = {'C'}; - CHECK_THROWS_AS(json::from_ubjson(vC), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vC), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON char: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vC), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vC), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON char: unexpected end of input"); CHECK(json::from_ubjson(vC, true, false).is_discarded()); } SECTION("sizes") { std::vector vU = {'[', '#', 'U'}; - CHECK_THROWS_AS(json::from_ubjson(vU), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vU), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(vU), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vU), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); CHECK(json::from_ubjson(vU, true, false).is_discarded()); std::vector vi = {'[', '#', 'i'}; - CHECK_THROWS_AS(json::from_ubjson(vi), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vi), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vi), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vi), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); CHECK(json::from_ubjson(vi, true, false).is_discarded()); std::vector vI = {'[', '#', 'I'}; - CHECK_THROWS_AS(json::from_ubjson(vI), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vI), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vI), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vI), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); CHECK(json::from_ubjson(vI, true, false).is_discarded()); std::vector vl = {'[', '#', 'l'}; - CHECK_THROWS_AS(json::from_ubjson(vl), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vl), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vl), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vl), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); CHECK(json::from_ubjson(vl, true, false).is_discarded()); std::vector vL = {'[', '#', 'L'}; - CHECK_THROWS_AS(json::from_ubjson(vL), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vL), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vL), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vL), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input"); CHECK(json::from_ubjson(vL, true, false).is_discarded()); std::vector v0 = {'[', '#', 'T', ']'}; - CHECK_THROWS_AS(json::from_ubjson(v0), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v0), "[json.exception.parse_error.113] parse error at byte 3: syntax error while parsing UBJSON size: expected length type specification (U, i, I, l, L) after '#'; last byte: 0x54"); + CHECK_THROWS_AS(_ = json::from_ubjson(v0), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v0), "[json.exception.parse_error.113] parse error at byte 3: syntax error while parsing UBJSON size: expected length type specification (U, i, I, l, L) after '#'; last byte: 0x54"); CHECK(json::from_ubjson(v0, true, false).is_discarded()); } SECTION("types") { std::vector v0 = {'[', '$'}; - CHECK_THROWS_AS(json::from_ubjson(v0), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v0), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing UBJSON type: unexpected end of input"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(v0), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v0), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing UBJSON type: unexpected end of input"); CHECK(json::from_ubjson(v0, true, false).is_discarded()); std::vector vi = {'[', '$', '#'}; - CHECK_THROWS_AS(json::from_ubjson(vi), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vi), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON value: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vi), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vi), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(vi, true, false).is_discarded()); std::vector vT = {'[', '$', 'T'}; - CHECK_THROWS_AS(json::from_ubjson(vT), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vT), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON value: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vT), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vT), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(vT, true, false).is_discarded()); } SECTION("arrays") { std::vector vST = {'[', '$', 'i', '#', 'i', 2, 1}; - CHECK_THROWS_AS(json::from_ubjson(vST), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vST), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON number: unexpected end of input"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(vST), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vST), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON number: unexpected end of input"); CHECK(json::from_ubjson(vST, true, false).is_discarded()); std::vector vS = {'[', '#', 'i', 2, 'i', 1}; - CHECK_THROWS_AS(json::from_ubjson(vS), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vS), "[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing UBJSON value: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vS), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vS), "[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(vS, true, false).is_discarded()); std::vector v = {'[', 'i', 2, 'i', 1}; - CHECK_THROWS_AS(json::from_ubjson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing UBJSON value: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(v, true, false).is_discarded()); } SECTION("objects") { std::vector vST = {'{', '$', 'i', '#', 'i', 2, 'i', 1, 'a', 1}; - CHECK_THROWS_AS(json::from_ubjson(vST), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vST), "[json.exception.parse_error.110] parse error at byte 11: syntax error while parsing UBJSON value: unexpected end of input"); + json _; + CHECK_THROWS_AS(_ = json::from_ubjson(vST), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vST), "[json.exception.parse_error.110] parse error at byte 11: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(vST, true, false).is_discarded()); std::vector vT = {'{', '$', 'i', 'i', 1, 'a', 1}; - CHECK_THROWS_AS(json::from_ubjson(vT), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vT), "[json.exception.parse_error.112] parse error at byte 4: syntax error while parsing UBJSON size: expected '#' after type information; last byte: 0x69"); + CHECK_THROWS_AS(_ = json::from_ubjson(vT), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vT), "[json.exception.parse_error.112] parse error at byte 4: syntax error while parsing UBJSON size: expected '#' after type information; last byte: 0x69"); CHECK(json::from_ubjson(vT, true, false).is_discarded()); std::vector vS = {'{', '#', 'i', 2, 'i', 1, 'a', 'i', 1}; - CHECK_THROWS_AS(json::from_ubjson(vS), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vS), "[json.exception.parse_error.110] parse error at byte 10: syntax error while parsing UBJSON value: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vS), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vS), "[json.exception.parse_error.110] parse error at byte 10: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(vS, true, false).is_discarded()); std::vector v = {'{', 'i', 1, 'a', 'i', 1}; - CHECK_THROWS_AS(json::from_ubjson(v), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing UBJSON value: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v), "[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(v, true, false).is_discarded()); std::vector v2 = {'{', 'i', 1, 'a', 'i', 1, 'i'}; - CHECK_THROWS_AS(json::from_ubjson(v2), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v2), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON number: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(v2), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v2), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON number: unexpected end of input"); CHECK(json::from_ubjson(v2, true, false).is_discarded()); std::vector v3 = {'{', 'i', 1, 'a'}; - CHECK_THROWS_AS(json::from_ubjson(v3), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(v3), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing UBJSON value: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(v3), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(v3), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(v3, true, false).is_discarded()); std::vector vST1 = {'{', '$', 'd', '#', 'i', 2, 'i', 1, 'a'}; - CHECK_THROWS_AS(json::from_ubjson(vST1), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vST1), "[json.exception.parse_error.110] parse error at byte 10: syntax error while parsing UBJSON number: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vST1), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vST1), "[json.exception.parse_error.110] parse error at byte 10: syntax error while parsing UBJSON number: unexpected end of input"); CHECK(json::from_ubjson(vST1, true, false).is_discarded()); std::vector vST2 = {'{', '#', 'i', 2, 'i', 1, 'a'}; - CHECK_THROWS_AS(json::from_ubjson(vST2), json::parse_error&); - CHECK_THROWS_WITH(json::from_ubjson(vST2), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON value: unexpected end of input"); + CHECK_THROWS_AS(_ = json::from_ubjson(vST2), json::parse_error&); + CHECK_THROWS_WITH(_ = json::from_ubjson(vST2), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON value: unexpected end of input"); CHECK(json::from_ubjson(vST2, true, false).is_discarded()); } } diff --git a/test/src/unit-unicode.cpp b/test/src/unit-unicode.cpp index e69639f4..0f499c70 100644 --- a/test/src/unit-unicode.cpp +++ b/test/src/unit-unicode.cpp @@ -158,13 +158,14 @@ void check_utf8string(bool success_expected, int byte1, int byte2 = -1, int byte CAPTURE(json_string) + json _; if (success_expected) { - CHECK_NOTHROW(json::parse(json_string)); + CHECK_NOTHROW(_ = json::parse(json_string)); } else { - CHECK_THROWS_AS(json::parse(json_string), json::parse_error&); + CHECK_THROWS_AS(_ = json::parse(json_string), json::parse_error&); } } } @@ -1051,7 +1052,8 @@ TEST_CASE("Unicode" * doctest::skip()) json_text += "\""; CAPTURE(json_text) - CHECK_NOTHROW(json::parse(json_text)); + json _; + CHECK_NOTHROW(_ = json::parse(json_text)); } } @@ -1059,32 +1061,34 @@ TEST_CASE("Unicode" * doctest::skip()) { SECTION("incorrect surrogate values") { - CHECK_THROWS_AS(json::parse("\"\\uDC00\\uDC00\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uDC00\\uDC00\""), + json _; + + CHECK_THROWS_AS(_ = json::parse("\"\\uDC00\\uDC00\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uDC00\\uDC00\""), "[json.exception.parse_error.101] parse error at line 1, column 7: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF; last read: '\"\\uDC00'"); - CHECK_THROWS_AS(json::parse("\"\\uD7FF\\uDC00\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uD7FF\\uDC00\""), + CHECK_THROWS_AS(_ = json::parse("\"\\uD7FF\\uDC00\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uD7FF\\uDC00\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF; last read: '\"\\uD7FF\\uDC00'"); - CHECK_THROWS_AS(json::parse("\"\\uD800]\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uD800]\""), + CHECK_THROWS_AS(_ = json::parse("\"\\uD800]\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uD800]\""), "[json.exception.parse_error.101] parse error at line 1, column 8: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800]'"); - CHECK_THROWS_AS(json::parse("\"\\uD800\\v\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uD800\\v\""), + CHECK_THROWS_AS(_ = json::parse("\"\\uD800\\v\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uD800\\v\""), "[json.exception.parse_error.101] parse error at line 1, column 9: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\v'"); - CHECK_THROWS_AS(json::parse("\"\\uD800\\u123\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uD800\\u123\""), + CHECK_THROWS_AS(_ = json::parse("\"\\uD800\\u123\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uD800\\u123\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: '\\u' must be followed by 4 hex digits; last read: '\"\\uD800\\u123\"'"); - CHECK_THROWS_AS(json::parse("\"\\uD800\\uDBFF\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uD800\\uDBFF\""), + CHECK_THROWS_AS(_ = json::parse("\"\\uD800\\uDBFF\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uD800\\uDBFF\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\uDBFF'"); - CHECK_THROWS_AS(json::parse("\"\\uD800\\uE000\""), json::parse_error&); - CHECK_THROWS_WITH(json::parse("\"\\uD800\\uE000\""), + CHECK_THROWS_AS(_ = json::parse("\"\\uD800\\uE000\""), json::parse_error&); + CHECK_THROWS_WITH(_ = json::parse("\"\\uD800\\uE000\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\uE000'"); } } @@ -1203,8 +1207,9 @@ TEST_CASE("Unicode" * doctest::skip()) SECTION("error for incomplete/wrong BOM") { - CHECK_THROWS_AS(json::parse("\xef\xbb"), json::parse_error&); - CHECK_THROWS_AS(json::parse("\xef\xbb\xbb"), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse("\xef\xbb"), json::parse_error&); + CHECK_THROWS_AS(_ = json::parse("\xef\xbb\xbb"), json::parse_error&); } } @@ -1215,6 +1220,7 @@ void roundtrip(bool success_expected, const std::string& s); void roundtrip(bool success_expected, const std::string& s) { CAPTURE(s) + json _; // create JSON string value json j = s; @@ -1230,11 +1236,11 @@ void roundtrip(bool success_expected, const std::string& s) if (s[0] != '\0') { // parsing JSON text succeeds - CHECK_NOTHROW(json::parse(ps)); + CHECK_NOTHROW(_ = json::parse(ps)); } // roundtrip succeeds - CHECK_NOTHROW(json::parse(j.dump())); + CHECK_NOTHROW(_ = json::parse(j.dump())); // after roundtrip, the same string is stored json jr = json::parse(j.dump()); @@ -1246,7 +1252,7 @@ void roundtrip(bool success_expected, const std::string& s) CHECK_THROWS_AS(j.dump(), json::type_error&); // parsing JSON text fails - CHECK_THROWS_AS(json::parse(ps), json::parse_error&); + CHECK_THROWS_AS(_ = json::parse(ps), json::parse_error&); } } } diff --git a/test/src/unit-wstring.cpp b/test/src/unit-wstring.cpp index 85aa04db..59826533 100644 --- a/test/src/unit-wstring.cpp +++ b/test/src/unit-wstring.cpp @@ -70,7 +70,8 @@ TEST_CASE("wide strings") if (wstring_is_utf16()) { std::wstring w = L"\"\xDBFF"; - CHECK_THROWS_AS(json::parse(w), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(w), json::parse_error&); } } @@ -89,7 +90,8 @@ TEST_CASE("wide strings") if (wstring_is_utf16()) { std::u16string w = u"\"\xDBFF"; - CHECK_THROWS_AS(json::parse(w), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(w), json::parse_error&); } } @@ -108,7 +110,8 @@ TEST_CASE("wide strings") if (u32string_is_utf32()) { std::u32string w = U"\"\x110000"; - CHECK_THROWS_AS(json::parse(w), json::parse_error&); + json _; + CHECK_THROWS_AS(_ = json::parse(w), json::parse_error&); } } } From 24fa285edbca7689fa2a9f28a964d1e803a0a635 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 2 Jul 2019 21:15:52 +0200 Subject: [PATCH 7/7] :memo: remove HEDLEY annotation from documentation --- doc/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/Makefile b/doc/Makefile index c255f972..07e417c1 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -61,6 +61,8 @@ doxygen: create_output create_links $(SED) -i 's@template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer>@@g' html/*.html $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html + $(SED) -i 's@JSON_HEDLEY_RETURNS_NON_NULL@@g' html/*.html + $(SED) -i 's@JSON_HEDLEY_WARN_UNUSED_RESULT@@g' html/*.html upload: clean doxygen check_output scripts/git-update-ghpages nlohmann/json html