Speculative fix for global symbol issues for Edward

Let’s see if an explicit static at file scope is better or different
to an anonymous namespace scope
This commit is contained in:
James Turner 2018-05-03 14:29:07 +01:00
parent 5710d33dbf
commit b6f5b40557

View File

@ -668,9 +668,9 @@ SGSubsystemGroup::Member::update (double delta_time_sec)
namespace {
SGSubsystemMgr* global_defaultSubsystemManager = nullptr;
void registerSubsystemCommands();
} // end of anonymous namespace
SGSubsystemMgr::SGSubsystemMgr () :
@ -912,19 +912,19 @@ namespace {
};
using SybsystemRegistrationVec = std::vector<RegisteredSubsystemData>;
SybsystemRegistrationVec global_registrations;
SybsystemRegistrationVec::const_iterator findRegistration(const std::string& name)
{
auto it = std::find_if(global_registrations.begin(),
global_registrations.end(),
[name](const RegisteredSubsystemData& d)
{ return name == d.name; });
return it;
}
} // of anonymous namespace
static SybsystemRegistrationVec global_registrations;
SybsystemRegistrationVec::const_iterator findRegistration(const std::string& name)
{
auto it = std::find_if(global_registrations.begin(),
global_registrations.end(),
[name](const RegisteredSubsystemData& d)
{ return name == d.name; });
return it;
}
void SGSubsystemMgr::registerSubsystem(const std::string& name,
SubsystemFactoryFunctor f,
GroupType group,