summaryrefslogtreecommitdiff
path: root/zen/sys_version.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-10-03 01:04:14 +0000
committerB Stack <bgstack15@gmail.com>2020-10-03 01:04:14 +0000
commit0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c (patch)
treed8a89392817379e3036c42eedebf33d4fb372dfd /zen/sys_version.cpp
parentMerge branch '11.1' into 'master' (diff)
parentadd upstream 11.2 (diff)
downloadFreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.tar.gz
FreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.tar.bz2
FreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.zip
Merge branch '11.2' into 'master'11.2
add upstream 11.2 See merge request opensource-tracking/FreeFileSync!26
Diffstat (limited to 'zen/sys_version.cpp')
-rw-r--r--zen/sys_version.cpp21
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;
}
bgstack15