aboutsummaryrefslogtreecommitdiff
path: root/primedev/squirrel
diff options
context:
space:
mode:
authorJan <sentrycraft123@gmail.com>2024-06-17 14:35:59 +0200
committerGitHub <noreply@github.com>2024-06-17 14:35:59 +0200
commitec974f60cbfa3814c5d654a0f77f0b27a6cc5d94 (patch)
tree502667bc1b57f2dc98961924293c26849cf62de1 /primedev/squirrel
parent75bb4143ced983be7d76f154fc0016d17fc92b65 (diff)
downloadNorthstarLauncher-ec974f60cbfa3814c5d654a0f77f0b27a6cc5d94.tar.gz
NorthstarLauncher-ec974f60cbfa3814c5d654a0f77f0b27a6cc5d94.zip
Don't instantiate templates before declaration, add missing instantiation (#706)
In C++ explicit template instantiations need to be done AFTER template declarations are made.
Diffstat (limited to 'primedev/squirrel')
-rw-r--r--primedev/squirrel/squirrel.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/primedev/squirrel/squirrel.cpp b/primedev/squirrel/squirrel.cpp
index 41a6a782..f6df0c5f 100644
--- a/primedev/squirrel/squirrel.cpp
+++ b/primedev/squirrel/squirrel.cpp
@@ -157,11 +157,6 @@ const char* SQTypeNameFromID(int type)
return "";
}
-// needed to define implementations for squirrelmanager outside of squirrel.h without compiler errors
-template class SquirrelManager<ScriptContext::SERVER>;
-template class SquirrelManager<ScriptContext::CLIENT>;
-template class SquirrelManager<ScriptContext::UI>;
-
template <ScriptContext context> void SquirrelManager<context>::VMCreated(CSquirrelVM* newSqvm)
{
m_pSQVM = newSqvm;
@@ -845,3 +840,12 @@ void InitialiseSquirrelManagers()
g_pSquirrel<ScriptContext::UI> = new SquirrelManager<ScriptContext::UI>;
g_pSquirrel<ScriptContext::SERVER> = new SquirrelManager<ScriptContext::SERVER>;
}
+
+// needed to define implementations for squirrelmanager outside of squirrel.h without compiler errors
+template class SquirrelManager<ScriptContext::SERVER>;
+template class SquirrelManager<ScriptContext::CLIENT>;
+template class SquirrelManager<ScriptContext::UI>;
+
+template std::shared_ptr<spdlog::logger> NS::log::squirrel_logger<ScriptContext::SERVER>();
+template std::shared_ptr<spdlog::logger> NS::log::squirrel_logger<ScriptContext::CLIENT>();
+template std::shared_ptr<spdlog::logger> NS::log::squirrel_logger<ScriptContext::UI>();