Revert "fix up static, so works as DLL (#559)"
authorAdrian Bunk <bunk@debian.org>
Sun, 10 May 2020 08:39:29 +0000 (11:39 +0300)
committerGianfranco Costamagna <locutusofborg@debian.org>
Tue, 26 May 2020 15:56:33 +0000 (16:56 +0100)
This reverts commit 774f25800e6f19f4b927023c85d1389af322da5e.

Gbp-Pq: Name 0005-Revert-fix-up-static-so-works-as-DLL-559.patch

include/yaml-cpp/node/detail/node_data.h
include/yaml-cpp/node/impl.h
src/node_data.cpp

index 82fb79adef9edb7db04442aa75ec6fe086ef27f2..50bcd74352da9baa5b8f919312f6780eec1621a7 100644 (file)
@@ -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;
index de2bf443363cdea2db4f8ddcdeffe7b4f3520552..20c487a687f62f3c73d045de00112ee420ee7e37 100644 (file)
@@ -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) {
index 04104b79f060b6b56933c349a2fbe4fbdcdd68a5..34d81f75be9b7f8088b23b97622506fd663891fd 100644 (file)
 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),