Skip to content

Commit

Permalink
fix(JSON): explicitly instantiate and export SharedPtr for JSON::Arra…
Browse files Browse the repository at this point in the history
…y and JSON::Object (-fvisibility=hidden) (#4393, #3331)
  • Loading branch information
matejk committed Jan 13, 2024
1 parent 77b520f commit fc65f91
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions JSON/include/Poco/JSON/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@


namespace Poco {

namespace JSON {

class JSON_API Array;

}

// Explicitly instantiated shared pointer in JSON library
extern template class JSON_API Poco::SharedPtr<Poco::JSON::Array>;

namespace JSON {

class Object;

Expand Down
9 changes: 9 additions & 0 deletions JSON/include/Poco/JSON/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,17 @@


namespace Poco {

namespace JSON {

class JSON_API Object;

}

// Explicitly instatiated shared pointer in JSON library
extern template class JSON_API Poco::SharedPtr<Poco::JSON::Object>;

namespace JSON {

class JSON_API Object
/// Represents a JSON object. Object provides a representation based on
Expand Down
4 changes: 4 additions & 0 deletions JSON/src/Array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

using Poco::Dynamic::Var;

// Explicitly instatiated shared pointer in JSON library is required to
// have known instance of the pointer to be used with VarHolder when
// compiling with -fvisibility=hidden
template class Poco::SharedPtr<Poco::JSON::Array>;

namespace Poco {
namespace JSON {
Expand Down
5 changes: 5 additions & 0 deletions JSON/src/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@

using Poco::Dynamic::Var;

// Explicitly instatiated shared pointer in JSON library is required to
// have known instance of the pointer to be used with VarHolder when
// compiling with -fvisibility=hidden
template class Poco::SharedPtr<Poco::JSON::Object>;

namespace Poco {

namespace JSON {


Expand Down

0 comments on commit fc65f91

Please sign in to comment.