summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2014-02-03 22:29:31 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2014-02-03 22:29:31 (GMT)
commit76a8030f939360bd39bc940842f79175c47ed828 (patch)
tree2460b8aed34b1dc39f26999cb2294274056a1448 /win
parent95a6025facddaf366bf92837026bdcafec4561ec (diff)
parent9acd6848382529da76b66a3108c7cceb755dcffa (diff)
downloadtcl-76a8030f939360bd39bc940842f79175c47ed828.zip
tcl-76a8030f939360bd39bc940842f79175c47ed828.tar.gz
tcl-76a8030f939360bd39bc940842f79175c47ed828.tar.bz2
merge trunk
Diffstat (limited to 'win')
-rw-r--r--win/makefile.vc2
-rw-r--r--win/tclWinInit.c18
2 files changed, 15 insertions, 5 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index 19b5614..8c65bd0 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -989,7 +989,7 @@ $(TMP_DIR)\tclOOStubLib.obj: $(GENERICDIR)\tclOOStubLib.c
$(TMP_DIR)\tclsh.exe.manifest: $(WINDIR)\tclsh.exe.manifest.in
@nmakehlp -s << $** >$@
@MACHINE@ $(MACHINE:IX86=X86)
-@TCL_WIN_VERSION@ $(TCL_DOTVERSION).0.0
+@TCL_WIN_VERSION@ $(DOTVERSION).0.0
<<
#---------------------------------------------------------------------
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 7b027c5..b3f8f41 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -530,7 +530,8 @@ TclpSetVariables(
SYSTEM_INFO info;
OemId oemId;
} sys;
- OSVERSIONINFOW osInfo;
+ static OSVERSIONINFOW osInfo;
+ static int osInfoInitialized = 0;
Tcl_DString ds;
TCHAR szUserName[UNLEN+1];
DWORD cchUserNameLen = UNLEN;
@@ -538,9 +539,18 @@ TclpSetVariables(
Tcl_SetVar2Ex(interp, "tclDefaultLibrary", NULL,
TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY);
- osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
- GetVersionExW(&osInfo);
-
+ if (!osInfoInitialized) {
+ HANDLE handle = LoadLibraryW(L"NTDLL");
+ int(*getversion)(void *) = (int(*)(void *))GetProcAddress(handle, "RtlGetVersion");
+ osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
+ if (!getversion || getversion(&osInfo)) {
+ GetVersionExW(&osInfo);
+ }
+ if (handle) {
+ FreeLibrary(handle);
+ }
+ osInfoInitialized = 1;
+ }
GetSystemInfo(&sys.info);
/*