Skip to content

Commit cf560b3

Browse files
author
jan.nijtmans
committed
Fix [0f19edcb78]: Windows 11 not reported in tcl_platform(osVersion)
2 parents 72eb4e4 + ce9fb3b commit cf560b3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

unix/tclUnixInit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,9 @@ TclpSetVariables(
895895

896896
GetSystemInfo(&sysInfo);
897897

898+
if (osInfo.dwMajorVersion == 10 && osInfo.dwBuildNumber >= 22000) {
899+
osInfo.dwMajorVersion = 11;
900+
}
898901
Tcl_SetVar2(interp, "tcl_platform", "os", "Windows NT", TCL_GLOBAL_ONLY);
899902
sprintf(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion);
900903
Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY);

win/tclWinInit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ TclpSetVariables(
552552
TCL_GLOBAL_ONLY);
553553
Tcl_SetVar2(interp, "tcl_platform", "os",
554554
"Windows NT", TCL_GLOBAL_ONLY);
555+
if (osInfo.dwMajorVersion == 10 && osInfo.dwBuildNumber >= 22000) {
556+
osInfo.dwMajorVersion = 11;
557+
}
555558
wsprintfA(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion);
556559
Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY);
557560
if (sys.oemId.wProcessorArchitecture < NUMPROCESSORS) {

0 commit comments

Comments
 (0)