summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 8043971..7e33234 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinInit.c,v 1.83 2009/08/02 10:41:09 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinInit.c,v 1.84 2009/11/18 21:59:50 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -472,8 +472,10 @@ TclpSetVariables(
{
const char *ptr;
char buffer[TCL_INTEGER_SPACE * 2];
- SYSTEM_INFO sysInfo, *sysInfoPtr = &sysInfo;
- OemId *oemId;
+ union {
+ SYSTEM_INFO info;
+ OemId oemId;
+ } sys;
OSVERSIONINFOA osInfo;
Tcl_DString ds;
WCHAR szUserName[UNLEN+1];
@@ -485,8 +487,7 @@ TclpSetVariables(
osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
GetVersionExA(&osInfo);
- oemId = (OemId *) sysInfoPtr;
- GetSystemInfo(&sysInfo);
+ GetSystemInfo(&sys.info);
/*
* Define the tcl_platform array.
@@ -500,9 +501,9 @@ TclpSetVariables(
}
wsprintfA(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion);
Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY);
- if (oemId->wProcessorArchitecture < NUMPROCESSORS) {
+ if (sys.oemId.wProcessorArchitecture < NUMPROCESSORS) {
Tcl_SetVar2(interp, "tcl_platform", "machine",
- processors[oemId->wProcessorArchitecture],
+ processors[sys.oemId.wProcessorArchitecture],
TCL_GLOBAL_ONLY);
}