[PATCH] Export YAML::detail::node::m_amount
authorPino Toscano <toscano.pino@tiscali.it>
Sun, 18 Apr 2021 08:29:59 +0000 (10:29 +0200)
committerGianfranco Costamagna <locutusofborg@debian.org>
Sat, 13 Nov 2021 20:48:59 +0000 (20:48 +0000)
The internal header node/detail/node.h is included by public headers;
YAML::detail::node is implemented in the header itself, and thus it gets
inlined... except for its static m_amount class member, which is
instantiated in the library only. Right now all the symbols of yaml-cpp
are exported (nothing is hidden), so the linker will find node::m_amount
in the yaml-cpp library.

As solution/workaround, explicitly export YAML::detail::node::m_amount.

Gbp-Pq: Name export-m_amount.patch

src/node_data.cpp

index da2aefce94b16fadbcfb7a099c13736b2bc41547..8f5422ae6e1191eaf2cc3dcd7b63fe6aa9eea686 100644 (file)
@@ -13,7 +13,7 @@
 
 namespace YAML {
 namespace detail {
-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() {
   static const std::string svalue;