From 2c6651ef12a2d61cb565b7ae4ae0bda42f79b644 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 5 Nov 2021 11:19:06 +0100 Subject: [PATCH 1/3] Include macOS 12 name in wxGetOsDescription() --- src/osx/cocoa/utils_base.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osx/cocoa/utils_base.mm b/src/osx/cocoa/utils_base.mm index bc3c1dfbbe..6b27402dfe 100644 --- a/src/osx/cocoa/utils_base.mm +++ b/src/osx/cocoa/utils_base.mm @@ -115,6 +115,9 @@ wxString wxGetOsDescription() case 11: osName = "Big Sur"; break; + case 12: + osName = "Monterey"; + break; } } #else From 6cef0c046421d0f493159ac5ce70b2126e6d012b Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 5 Nov 2021 11:55:51 +0100 Subject: [PATCH 2/3] Include Windows 11 name in wxGetOsDescription() The major version is not changed for Windows 11 from Windows 10, but the build number 22000 can be used to determine it's Win 11. --- src/msw/utils.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index f4e55c31ab..8f5402f6e2 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1134,9 +1134,14 @@ wxString wxGetOsDescription() break; case 10: - str = wxIsWindowsServer() == 1 - ? "Windows Server 2016" - : "Windows 10"; + if (info.dwBuildNumber >= 22000) + str = wxIsWindowsServer() == 1 + ? "Windows Server 2022" + : "Windows 11"; + else + str = wxIsWindowsServer() == 1 + ? "Windows Server 2016" + : "Windows 10"; break; } From 69aedae382d5a8a1ad96b8e2f4516391dba41d51 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 5 Nov 2021 12:12:04 +0100 Subject: [PATCH 3/3] Include Windows 11 in wxGetOsVersion() table --- interface/wx/utils.h | 120 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 101 insertions(+), 19 deletions(-) diff --git a/interface/wx/utils.h b/interface/wx/utils.h index 104eaccae9..4e83ce490f 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -917,7 +917,7 @@ wxString wxGetOsDescription(); numbers will have a value of -1. On systems where only the micro version can't be detected or doesn't make - sense such as Windows, it will have a value of 0. + sense, it will have a value of 0. For Unix-like systems (@c wxOS_UNIX) the major, minor, and micro version integers will contain the kernel's major, minor, and micro version @@ -928,24 +928,106 @@ wxString wxGetOsDescription(); natural version numbers associated with the OS; e.g. "10", "11" and "2" if the machine is using macOS El Capitan 10.11.2. - For Windows-like systems (@c wxOS_WINDOWS) the major and minor version integers will - contain the following values: - @beginTable - @row3col{Windows OS name, Major version, Minor version} - @row3col{Windows 10, 10, 0} - @row3col{Windows Server 2016, 10, 0} - @row3col{Windows 8.1, 6, 3} - @row3col{Windows Server 2012 R2, 6, 3} - @row3col{Windows 8, 6, 2} - @row3col{Windows Server 2012, 6, 2} - @row3col{Windows 7, 6, 1} - @row3col{Windows Server 2008 R2, 6, 1} - @row3col{Windows Server 2008, 6, 0} - @row3col{Windows Vista, 6, 0} - @row3col{Windows Server 2003 R2, 5, 2} - @row3col{Windows Server 2003, 5, 2} - @row3col{Windows XP, 5, 1} - @endDefList + For Windows-like systems (@c wxOS_WINDOWS) the major, minor and micro + (equal to the build number) version integers will contain the following values: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows OS nameMajor versionMinor versionBuild number
Windows 11100>= 22000
Windows Server 2022100>= 22000
Windows 10100
Windows Server 2016100
Windows 8.163
Windows Server 2012 R263
Windows 862
Windows Server 201262
Windows 761
Windows 2008 R261
Windows Vista60
Windows Server 200860
Windows Server 2003 R252
Windows Server 200352
Windows XP51
See the MSDN for more info about the values above.