diff --git a/Global.h b/Global.h index 66f61d4d4..c8b4c1d21 100644 --- a/Global.h +++ b/Global.h @@ -138,6 +138,7 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size."); #include #include #include +#include //The only available version is 3, as of Boost 1.50 #include diff --git a/lib/VCMIDirs.cpp b/lib/VCMIDirs.cpp index 26f8c6645..a0ac3f6d0 100644 --- a/lib/VCMIDirs.cpp +++ b/lib/VCMIDirs.cpp @@ -705,12 +705,8 @@ namespace VCMIDirs static VCMIDirsIOS singleton; #endif - static bool initialized = false; - if (!initialized) - { - singleton.init(); - initialized = true; - } + static std::once_flag flag; + std::call_once(flag, [] { singleton.init(); }); return singleton; } }