Skip to content

Commit

Permalink
Fix [0f19edcb78]: Windows 11 not reported in tcl_platform(osVersion)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Jan 6, 2023
2 parents 72eb4e4 + ce9fb3b commit cf560b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions unix/tclUnixInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,9 @@ TclpSetVariables(

GetSystemInfo(&sysInfo);

if (osInfo.dwMajorVersion == 10 && osInfo.dwBuildNumber >= 22000) {
osInfo.dwMajorVersion = 11;
}
Tcl_SetVar2(interp, "tcl_platform", "os", "Windows NT", TCL_GLOBAL_ONLY);
sprintf(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion);
Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY);
Expand Down
3 changes: 3 additions & 0 deletions win/tclWinInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ TclpSetVariables(
TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tcl_platform", "os",
"Windows NT", TCL_GLOBAL_ONLY);
if (osInfo.dwMajorVersion == 10 && osInfo.dwBuildNumber >= 22000) {
osInfo.dwMajorVersion = 11;
}
wsprintfA(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion);
Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY);
if (sys.oemId.wProcessorArchitecture < NUMPROCESSORS) {
Expand Down

0 comments on commit cf560b3

Please sign in to comment.