diff options
author | B Stack <bgstack15@gmail.com> | 2020-10-02 14:42:30 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-10-02 14:42:30 -0400 |
commit | 8aaf029ab6046eb8cbe600a548d176c1418bd99a (patch) | |
tree | d8a89392817379e3036c42eedebf33d4fb372dfd /zen/sys_version.cpp | |
parent | Merge branch '11.1' into 'master' (diff) | |
download | FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.tar.gz FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.tar.bz2 FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.zip |
add upstream 11.2
Diffstat (limited to 'zen/sys_version.cpp')
-rw-r--r-- | zen/sys_version.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/zen/sys_version.cpp b/zen/sys_version.cpp index 46918315..d07bbc33 100644 --- a/zen/sys_version.cpp +++ b/zen/sys_version.cpp @@ -78,14 +78,17 @@ OsVersionDetail zen::getOsVersionDetail() //throw SysError OsVersion zen::getOsVersion() { - try - { - static const OsVersionDetail verDetail = getOsVersionDetail(); //throw SysError - return verDetail.version; - } - catch (const SysError& e) + static const OsVersionDetail verDetail = [] { - std::cerr << utfTo<std::string>(e.toString()) << '\n'; - return {}; //sigh, it's a jungle out there: https://freefilesync.org/forum/viewtopic.php?t=7276 - } + try + { + return getOsVersionDetail(); //throw SysError + } + catch (const SysError& e) + { + std::cerr << utfTo<std::string>(e.toString()) << '\n'; + return OsVersionDetail{}; //sigh, it's a jungle out there: https://freefilesync.org/forum/viewtopic.php?t=7276 + } + }(); + return verDetail.version; } |