🔨 add NLOHMANN_JSON prefix and undef macros
This commit is contained in:
parent
1720bfedd1
commit
897362191d
20 changed files with 4055 additions and 2294 deletions
|
|
@ -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<typename string_t::value_type>(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) + ")"));
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class output_vector_adapter : public output_adapter_protocol<CharType>
|
|||
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<CharType>
|
|||
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<std::streamsize>(length));
|
||||
|
|
@ -88,7 +88,7 @@ class output_string_adapter : public output_adapter_protocol<CharType>
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue