diff options
author | Jan <sentrycraft123@gmail.com> | 2024-06-17 14:35:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-17 14:35:59 +0200 |
commit | ec974f60cbfa3814c5d654a0f77f0b27a6cc5d94 (patch) | |
tree | 502667bc1b57f2dc98961924293c26849cf62de1 | |
parent | 75bb4143ced983be7d76f154fc0016d17fc92b65 (diff) | |
download | NorthstarLauncher-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.
-rw-r--r-- | primedev/squirrel/squirrel.cpp | 14 |
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>(); |