fix: revert ABI breakage

add patch to revert abi breakage.

Log:
This commit is contained in:
liujianqiang 2022-04-22 19:46:52 +08:00
parent 13626af92a
commit f3cd0efd35
3 changed files with 5 additions and 7 deletions

View File

@ -81,7 +81,7 @@ class YAML_CPP_API node_data {
shared_memory_holder pMemory); shared_memory_holder pMemory);
public: public:
static const std::string& empty_scalar(); static std::string empty_scalar;
private: private:
void compute_seq_size() const; void compute_seq_size() const;

View File

@ -166,13 +166,13 @@ inline T Node::as(const S& fallback) const {
inline const std::string& Node::Scalar() const { inline const std::string& Node::Scalar() const {
if (!m_isValid) if (!m_isValid)
throw InvalidNode(m_invalidKey); throw InvalidNode(m_invalidKey);
return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar(); return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar;
} }
inline const std::string& Node::Tag() const { inline const std::string& Node::Tag() const {
if (!m_isValid) if (!m_isValid)
throw InvalidNode(m_invalidKey); throw InvalidNode(m_invalidKey);
return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar(); return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar;
} }
inline void Node::SetTag(const std::string& tag) { inline void Node::SetTag(const std::string& tag) {

View File

@ -15,10 +15,8 @@ namespace YAML {
namespace detail { namespace detail {
YAML_CPP_API std::atomic<size_t> node::m_amount{0}; YAML_CPP_API std::atomic<size_t> node::m_amount{0};
const std::string& node_data::empty_scalar() { std::string node_data::empty_scalar;
static const std::string svalue;
return svalue;
}
node_data::node_data() node_data::node_data()
: m_isDefined(false), : m_isDefined(false),