Skip to content

Commit

Permalink
Use dllexport for static variables
Browse files Browse the repository at this point in the history
  • Loading branch information
fintarin committed Apr 6, 2024
1 parent 4211547 commit 1192603
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions include/fintamath/core/CoreUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
#include <concepts>
#include <functional>

#ifdef _WIN32
#define FINTAMATH_API __declspec(dllexport)
#else
#define FINTAMATH_API
#endif

namespace fintamath {

template <typename From, typename To>
Expand Down
3 changes: 2 additions & 1 deletion include/fintamath/core/MathObjectBody.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <memory>

#include "fintamath/core/CoreUtils.hpp"
#include "fintamath/core/MathObjectClass.hpp"
#include "fintamath/core/MathObjectIdStorage.hpp"
#include "fintamath/core/Parser.hpp"
Expand All @@ -13,7 +14,7 @@ public: \
} \
\
private: \
static constexpr detail::MathObjectClassImpl \
FINTAMATH_API static constexpr detail::MathObjectClassImpl \
objClass{#Class, Parent::getClassStatic()};

#define FINTAMATH_PARENT_CLASS_BODY(Class, Parent) \
Expand Down
3 changes: 2 additions & 1 deletion include/fintamath/core/MathObjectClass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <unordered_set>

#include "fintamath/config/Config.hpp"
#include "fintamath/core/CoreUtils.hpp"

namespace fintamath {

Expand Down Expand Up @@ -46,7 +47,7 @@ class MathObjectClassImpl final {

Ptr parent;

[[maybe_unused]] inline static const Config config;
[[maybe_unused]] FINTAMATH_API inline static const Config config;
};

}
Expand Down

0 comments on commit 1192603

Please sign in to comment.