MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / SetupEnvironment

Function SetupEnvironment

src/util.cpp:759–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757}
758
759void SetupEnvironment()
760{
761 // On most POSIX systems (e.g. Linux, but not BSD) the environment's locale
762 // may be invalid, in which case the "C" locale is used as fallback.
763#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
764 try {
765 std::locale(""); // Raises a runtime error if current locale is invalid
766 } catch (const std::runtime_error&) {
767 setenv("LC_ALL", "C", 1);
768 }
769#endif
770 // The path locale is lazy initialized and to avoid deinitialization errors
771 // in multithreading environments, it is set explicitly by the main thread.
772 // A dummy locale is used to extract the internal default locale, used by
773 // boost::filesystem::path, which is then used to explicitly imbue the path.
774 std::locale loc = boost::filesystem::path::imbue(std::locale::classic());
775 boost::filesystem::path::imbue(loc);
776}
777
778bool SetupNetworking()
779{

Callers 6

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
BasicTestingSetupMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 2

BasicTestingSetupMethod · 0.68
mainFunction · 0.68