From ce9fb3bcfb5727f83db328e2ee54bc6b56c6e7ea Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 4 Jan 2023 23:21:16 +0000 Subject: Fix [0f19edcb78]: Windows 11 not reported in tcl_platform(osVersion) --- unix/tclUnixInit.c | 3 +++ win/tclWinInit.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 7467938..47b8df3 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -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); diff --git a/win/tclWinInit.c b/win/tclWinInit.c index eae4404..582c700 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -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) { -- cgit v0.12