diff --git a/include/fintamath/core/CoreUtils.hpp b/include/fintamath/core/CoreUtils.hpp index 5d03f73ed..3a7f2bb05 100644 --- a/include/fintamath/core/CoreUtils.hpp +++ b/include/fintamath/core/CoreUtils.hpp @@ -3,6 +3,12 @@ #include #include +#ifdef WIN32 +#define FINTAMATH_API __declspec(dllexport) +#else +#define FINTAMATH_API +#endif + namespace fintamath { template diff --git a/include/fintamath/core/MathObjectBody.hpp b/include/fintamath/core/MathObjectBody.hpp index 8918b4b83..cf152892b 100644 --- a/include/fintamath/core/MathObjectBody.hpp +++ b/include/fintamath/core/MathObjectBody.hpp @@ -19,7 +19,10 @@ public: \ private: \ using Class##Parser = detail::Parser>; \ \ - static Class##Parser &getParser(); \ + FINTAMATH_API static Class##Parser &getParser() { \ + FINTAMATH_API static Class##Parser parser; \ + return parser; \ + } \ \ public: \ static auto parse(std::string str) { \ @@ -38,8 +41,4 @@ public: \ \ private: -#define FINTAMATH_PARENT_CLASS_IMPLEMENTATION(Class) \ - Class::Class##Parser &Class::getParser() { \ - static Class##Parser parser; \ - return parser; \ - } +#define FINTAMATH_PARENT_CLASS_IMPLEMENTATION(Class)