Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Sofa/framework/Core/src/sofa/core/fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,13 @@ const sofa::core::objectmodel::BaseClass* GetClass(){return B::GetClass(); }
///
/// Once declare it is mandatory to also define the same functions.
/// For that you must use SOFA_DEFINE_OPAQUE_FUNCTION_BETWEEN_BASE_AND
#define SOFA_DECLARE_WITH_API_MACRO_OPAQUE_FUNCTION_BETWEEN_BASE_AND(TYPENAME, API_MACRO) \
template<> API_MACRO TYPENAME* castTo(sofa::core::objectmodel::Base* base); \
API_MACRO sofa::core::objectmodel::Base* castToBase(TYPENAME* b); \
namespace objectmodel::base { template<> API_MACRO const sofa::core::objectmodel::BaseClass* GetClass<TYPENAME>(); }

#define SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(TYPENAME) \
template<> SOFA_CORE_API TYPENAME* castTo(sofa::core::objectmodel::Base* base); \
SOFA_CORE_API sofa::core::objectmodel::Base* castToBase(TYPENAME* b); \
namespace objectmodel::base { template<> SOFA_CORE_API const sofa::core::objectmodel::BaseClass* GetClass<TYPENAME>(); }
SOFA_DECLARE_WITH_API_MACRO_OPAQUE_FUNCTION_BETWEEN_BASE_AND(TYPENAME, SOFA_CORE_API)

/// Define the opaque function signature for a type that in-herit from Base.
///
Expand Down
2 changes: 1 addition & 1 deletion Sofa/framework/Simulation/Core/src/sofa/simulation/fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SOFA_SIMULATION_CORE_API Node* getNodeFrom(sofa::core::objectmodel::BaseContext*

namespace sofa::core
{
SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::simulation::Node);
SOFA_DECLARE_WITH_API_MACRO_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::simulation::Node, SOFA_SIMULATION_CORE_API);
}

namespace sofa::simulation::common
Expand Down
Loading