mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Fix static initialization order problem
This commit is contained in:
parent
24816de6ca
commit
b6c2dec8fa
1 changed files with 8 additions and 4 deletions
|
|
@ -34,7 +34,11 @@ static uint64_t _debug_bit = 1;
|
||||||
typedef std::map<const char*,uint64_t> DebugMap;
|
typedef std::map<const char*,uint64_t> DebugMap;
|
||||||
|
|
||||||
namespace PBD {
|
namespace PBD {
|
||||||
DebugMap _debug_bit_map;
|
DebugMap & _debug_bit_map()
|
||||||
|
{
|
||||||
|
static DebugMap map;
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t PBD::DEBUG::Stateful = PBD::new_debug_bit ("stateful");
|
uint64_t PBD::DEBUG::Stateful = PBD::new_debug_bit ("stateful");
|
||||||
|
|
@ -50,7 +54,7 @@ uint64_t
|
||||||
PBD::new_debug_bit (const char* name)
|
PBD::new_debug_bit (const char* name)
|
||||||
{
|
{
|
||||||
uint64_t ret;
|
uint64_t ret;
|
||||||
_debug_bit_map.insert (make_pair (name, _debug_bit));
|
_debug_bit_map().insert (make_pair (name, _debug_bit));
|
||||||
ret = _debug_bit;
|
ret = _debug_bit;
|
||||||
_debug_bit <<= 1;
|
_debug_bit <<= 1;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -91,7 +95,7 @@ PBD::parse_debug_options (const char* str)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (map<const char*,uint64_t>::iterator i = _debug_bit_map.begin(); i != _debug_bit_map.end(); ++i) {
|
for (map<const char*,uint64_t>::iterator i = _debug_bit_map().begin(); i != _debug_bit_map().end(); ++i) {
|
||||||
if (strncasecmp (p, i->first, strlen (p)) == 0) {
|
if (strncasecmp (p, i->first, strlen (p)) == 0) {
|
||||||
bits |= i->second;
|
bits |= i->second;
|
||||||
}
|
}
|
||||||
|
|
@ -113,7 +117,7 @@ PBD::list_debug_options ()
|
||||||
|
|
||||||
vector<string> options;
|
vector<string> options;
|
||||||
|
|
||||||
for (map<const char*,uint64_t>::iterator i = _debug_bit_map.begin(); i != _debug_bit_map.end(); ++i) {
|
for (map<const char*,uint64_t>::iterator i = _debug_bit_map().begin(); i != _debug_bit_map().end(); ++i) {
|
||||||
options.push_back (i->first);
|
options.push_back (i->first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue