Add internal module type enum value for use with out-of-tree third party modules.

https://bitbucket.org/rude/love/pull-requests/79/add-pluggable-modules-to-the-build-system/
This commit is contained in:
Alex Szpakowski
2020-01-14 23:01:21 -04:00
parent 97a97af99a
commit 9ebb6a5c44
2 changed files with 11 additions and 7 deletions
+9 -6
View File
@@ -113,15 +113,18 @@ void Module::registerInstance(Module *instance)
registry.insert(make_pair(name, instance));
ModuleType moduletype = instance->getModuleType();
ModuleType mtype = instance->getModuleType();
if (instances[moduletype] != nullptr)
if (mtype != M_UNKNOWN)
{
printf("Warning: overwriting module instance %s with new instance %s\n",
instances[moduletype]->getName(), instance->getName());
}
if (instances[mtype] != nullptr)
{
printf("Warning: overwriting module instance %s with new instance %s\n",
instances[mtype]->getName(), instance->getName());
}
instances[moduletype] = instance;
instances[mtype] = instance;
}
}
Module *Module::getInstance(const std::string &name)