Skip to content

Commit

Permalink
Applies PR nlohmann/json#212 to support gcc 4.8.
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumeblanc committed Aug 24, 2017
1 parent beaea5c commit e3c1cd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions extern/json/README.ozz
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Local Modifications:
- Extracted include and source files from json package.
- Striped from unsued files.
- Creates a specific CMakeLists.txt
- Applies PR https://github.com/nlohmann/json/pull/212 to support gcc 4.8.
22 changes: 15 additions & 7 deletions extern/json/src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ SOFTWARE.
#error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
#endif
#elif defined(__GNUC__)
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40900
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800
#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
#endif
#endif
Expand Down Expand Up @@ -5603,7 +5603,10 @@ class basic_json

// insert to array and return iterator
iterator result(this);
result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
m_value.array->insert(pos.m_it.array_iterator, cnt, val);
result.m_it.array_iterator = m_value.array->begin() + insert_pos;

return result;
}

Expand Down Expand Up @@ -5667,10 +5670,12 @@ class basic_json

// insert to array and return iterator
iterator result(this);
result.m_it.array_iterator = m_value.array->insert(
pos.m_it.array_iterator,
first.m_it.array_iterator,
last.m_it.array_iterator);
auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
m_value.array->insert(pos.m_it.array_iterator,
first.m_it.array_iterator,
last.m_it.array_iterator);
result.m_it.array_iterator = m_value.array->begin() + insert_pos;

return result;
}

Expand Down Expand Up @@ -5714,7 +5719,10 @@ class basic_json

// insert to array and return iterator
iterator result(this);
result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, ilist);
auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
m_value.array->insert(pos.m_it.array_iterator, ilist);
result.m_it.array_iterator = m_value.array->begin() + insert_pos;

return result;
}

Expand Down

0 comments on commit e3c1cd5

Please sign in to comment.