From 7464265b22947131873f9b0f91f0e8651f3ce2fe Mon Sep 17 00:00:00 2001 From: frto027 Date: Sun, 11 Jan 2026 00:47:48 +0800 Subject: [PATCH] fix sources.hpp --- shared/sources.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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)); }