Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Fix symbol conflict in picojson.h with GCC 11 internal macro #267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions include/picojson.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ class value {
private:
template <typename T> value(const T *); // intentionally defined to block implicit conversion of pointer to bool
template <typename Iter> static void _indent(Iter os, int indent);
template <typename Iter> void _serialize(Iter os, int indent) const;
std::string _serialize(int indent) const;
template <typename Iter> void serialize_(Iter os, int indent) const;
std::string serialize_(int indent) const;
void clear();
};

Expand Down Expand Up @@ -557,11 +557,11 @@ template <typename Iter> void serialize_str(const std::string &s, Iter oi) {
}

template <typename Iter> void value::serialize(Iter oi, bool prettify) const {
return _serialize(oi, prettify ? 0 : -1);
return serialize_(oi, prettify ? 0 : -1);
}

inline std::string value::serialize(bool prettify) const {
return _serialize(prettify ? 0 : -1);
return serialize_(prettify ? 0 : -1);
}

template <typename Iter> void value::_indent(Iter oi, int indent) {
Expand All @@ -571,7 +571,7 @@ template <typename Iter> void value::_indent(Iter oi, int indent) {
}
}

template <typename Iter> void value::_serialize(Iter oi, int indent) const {
template <typename Iter> void value::serialize_(Iter oi, int indent) const {
switch (type_) {
case string_type:
serialize_str(*u_.string_, oi);
Expand All @@ -588,7 +588,7 @@ template <typename Iter> void value::_serialize(Iter oi, int indent) const {
if (indent != -1) {
_indent(oi, indent);
}
i->_serialize(oi, indent);
i->serialize_(oi, indent);
}
if (indent != -1) {
--indent;
Expand Down Expand Up @@ -616,7 +616,7 @@ template <typename Iter> void value::_serialize(Iter oi, int indent) const {
if (indent != -1) {
*oi++ = ' ';
}
i->second._serialize(oi, indent);
i->second.serialize_(oi, indent);
}
if (indent != -1) {
--indent;
Expand All @@ -636,9 +636,9 @@ template <typename Iter> void value::_serialize(Iter oi, int indent) const {
}
}

inline std::string value::_serialize(int indent) const {
inline std::string value::serialize_(int indent) const {
std::string s;
_serialize(std::back_inserter(s), indent);
serialize_(std::back_inserter(s), indent);
return s;
}

Expand Down