From b6f5b4055769abaf851f05c393247ff33fe84ce1 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 3 May 2018 14:29:07 +0100 Subject: [PATCH] Speculative fix for global symbol issues for Edward MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let’s see if an explicit static at file scope is better or different to an anonymous namespace scope --- simgear/structure/subsystem_mgr.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/simgear/structure/subsystem_mgr.cxx b/simgear/structure/subsystem_mgr.cxx index c5ae8cad..9bfe1b9b 100644 --- a/simgear/structure/subsystem_mgr.cxx +++ b/simgear/structure/subsystem_mgr.cxx @@ -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; - - 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,