log: make once_flag constinit
This ensures we'll error out at compile time rather than encounter a static initialisation ordering error.
This commit is contained in:
parent
f178159fba
commit
8bfb1e3d92
@ -45,10 +45,8 @@ cruft::log::needs_break (level_t level)
|
|||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// mingw#xxx: MinGW doesn't have once_flag so we just use an atomic bool.
|
static constinit std::once_flag s_sink_init;
|
||||||
// Pray that multiple threads don't run into an issue here.
|
static constinit std::unique_ptr<cruft::log::sink::base> s_default_sink;
|
||||||
static std::once_flag s_sink_init;
|
|
||||||
static std::unique_ptr<cruft::log::sink::base> s_default_sink;
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user