MCPcopy Create free account
hub / github.com/LUX-Core/lux / SetupEnvironment

Function SetupEnvironment

src/util.cpp:879–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877}
878
879void SetupEnvironment()
880{
881// On most POSIX systems (e.g. Linux, but not BSD) the environment's locale
882// may be invalid, in which case the "C" locale is used as fallback.
883#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
884 try {
885 std::locale(""); // Raises a runtime error if current locale is invalid
886 } catch (const std::runtime_error&) {
887 setenv("LC_ALL", "C", 1);
888 }
889#endif
890 // The path locale is lazy initialized and to avoid deinitialization errors
891 // in multithreading environments, it is set explicitly by the main thread.
892 // A dummy locale is used to extract the internal default locale, used by
893 // boost::filesystem::path, which is then used to explicitly imbue the path.
894 std::locale loc = boost::filesystem::path::imbue(std::locale::classic());
895 boost::filesystem::path::imbue(loc);
896}
897
898void SetThreadPriority(int nPriority)
899{

Callers 6

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
TestingSetupMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestingSetupMethod · 0.68
mainFunction · 0.68