diff --git a/shared/sources.hpp b/shared/sources.hpp index 02c1e5d..4ecdd8e 100644 --- a/shared/sources.hpp +++ b/shared/sources.hpp @@ -4,11 +4,13 @@ #include "config-utils/shared/config-utils.hpp" #include "types.hpp" +#define QOUNTERS_EXPORT __attribute__ ((visibility ("default"))) + namespace Qounters::Sources { - extern std::vector, Types::SourceUIFn>>> texts; - extern std::vector, Types::SourceUIFn>>> shapes; - extern std::vector, Types::SourceUIFn>>> colors; - extern std::vector, Types::SourceUIFn>>> enables; + extern QOUNTERS_EXPORT std::vector, Types::SourceUIFn>>> texts; + extern QOUNTERS_EXPORT std::vector, Types::SourceUIFn>>> shapes; + extern QOUNTERS_EXPORT std::vector, Types::SourceUIFn>>> colors; + extern QOUNTERS_EXPORT std::vector, Types::SourceUIFn>>> enables; struct PremadeInfo { std::string name; @@ -28,7 +30,7 @@ namespace Qounters::Sources { PremadeInfo* GetPremadeInfo(std::string const& mod, std::string const& name); template - T GetSource(std::vector> sourceVec, std::string source) { + T GetSource(std::vector>& sourceVec, std::string source) { for (auto& [str, ret] : sourceVec) { if (str == source) return ret; @@ -38,7 +40,7 @@ namespace Qounters::Sources { template inline void Register( - std::vector>> sourceVec, std::string source, T sourceFn, Types::SourceUIFn sourceUIFn + std::vector>>& sourceVec, std::string source, T sourceFn, Types::SourceUIFn sourceUIFn ) { sourceVec.emplace_back(source, std::make_pair(sourceFn, sourceUIFn)); }