Changeset View
Changeset View
Standalone View
Standalone View
src/util.cpp
Show First 20 Lines • Show All 721 Lines • ▼ Show 20 Lines | if (ret != NO_ERROR || LOBYTE(wsadata.wVersion) != 2 || | ||||
HIBYTE(wsadata.wVersion) != 2) { | HIBYTE(wsadata.wVersion) != 2) { | ||||
return false; | return false; | ||||
} | } | ||||
#endif | #endif | ||||
return true; | return true; | ||||
} | } | ||||
int GetNumCores() { | int GetNumCores() { | ||||
#if BOOST_VERSION >= 105600 | |||||
return boost::thread::physical_concurrency(); | return boost::thread::physical_concurrency(); | ||||
#else | |||||
// Must fall back to hardware_concurrency, which unfortunately counts | |||||
// virtual cores. | |||||
return boost::thread::hardware_concurrency(); | |||||
#endif | |||||
} | } | ||||
std::string CopyrightHolders(const std::string &strPrefix) { | std::string CopyrightHolders(const std::string &strPrefix) { | ||||
return strPrefix + | return strPrefix + | ||||
strprintf(_(COPYRIGHT_HOLDERS), _(COPYRIGHT_HOLDERS_SUBSTITUTION)); | strprintf(_(COPYRIGHT_HOLDERS), _(COPYRIGHT_HOLDERS_SUBSTITUTION)); | ||||
} | } | ||||
// Obtain the application startup time (used for uptime calculation) | // Obtain the application startup time (used for uptime calculation) | ||||
int64_t GetStartupTime() { | int64_t GetStartupTime() { | ||||
return nStartupTime; | return nStartupTime; | ||||
} | } |