namespace {
#ifdef DEBUG
-map<Msp::GL::Tag, string> tag_names;
+map<Msp::GL::Tag, string> &get_tag_names()
+{
+ static map<Msp::GL::Tag, string> names;
+ return names;
+}
#endif
}
{
#ifdef DEBUG
if(s)
- tag_names.insert(make_pair(*this, string(s)));
+ get_tag_names().insert(make_pair(*this, string(s)));
#endif
}
{
#ifdef DEBUG
if(!s.empty())
- tag_names.insert(make_pair(*this, s));
+ get_tag_names().insert(make_pair(*this, s));
#endif
}
string Tag::str() const
{
#ifdef DEBUG
- auto i=tag_names.find(*this);
- if(i!=tag_names.end())
+ const auto &names = get_tag_names();
+ auto i = names.find(*this);
+ if(i!=names.end())
return i->second;
#endif
return format("Tag(%d)", id);