From: Adrian Bunk Date: Sun, 10 May 2020 08:39:29 +0000 (+0300) Subject: Revert "fix up static, so works as DLL (#559)" X-Git-Tag: archive/raspbian/0.6.3-7+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8a867ed9dcc9c49d9f87a5189775ae04d3969d22;p=yaml-cpp.git Revert "fix up static, so works as DLL (#559)" This reverts commit 774f25800e6f19f4b927023c85d1389af322da5e. Gbp-Pq: Name 0005-Revert-fix-up-static-so-works-as-DLL-559.patch --- diff --git a/include/yaml-cpp/node/detail/node_data.h b/include/yaml-cpp/node/detail/node_data.h index 82fb79a..50bcd74 100644 --- a/include/yaml-cpp/node/detail/node_data.h +++ b/include/yaml-cpp/node/detail/node_data.h @@ -81,7 +81,7 @@ class YAML_CPP_API node_data { shared_memory_holder pMemory); public: - static const std::string& empty_scalar(); + static std::string empty_scalar; private: void compute_seq_size() const; diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h index de2bf44..20c487a 100644 --- a/include/yaml-cpp/node/impl.h +++ b/include/yaml-cpp/node/impl.h @@ -156,13 +156,13 @@ inline T Node::as(const S& fallback) const { inline const std::string& Node::Scalar() const { if (!m_isValid) throw InvalidNode(); - 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 { if (!m_isValid) throw InvalidNode(); - 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) { diff --git a/src/node_data.cpp b/src/node_data.cpp index 04104b7..34d81f7 100644 --- a/src/node_data.cpp +++ b/src/node_data.cpp @@ -13,10 +13,7 @@ namespace YAML { namespace detail { -const std::string& node_data::empty_scalar() { - static const std::string svalue; - return svalue; -} +std::string node_data::empty_scalar; node_data::node_data() : m_isDefined(false),