diff options
author | hobbs <hobbs@noemail.net> | 2001-05-30 22:41:29 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2001-05-30 22:41:29 (GMT) |
commit | 56c176627a2cf427f263786dbeb87ea8a6095f5f (patch) | |
tree | 800258968926f23eae3e6b5868593bdaa87689ae /win/tkWinX.c | |
parent | fcb0d7b2dad7a7b498ac6ef82df40dffc04258f9 (diff) | |
download | tk-56c176627a2cf427f263786dbeb87ea8a6095f5f.zip tk-56c176627a2cf427f263786dbeb87ea8a6095f5f.tar.gz tk-56c176627a2cf427f263786dbeb87ea8a6095f5f.tar.bz2 |
* win/tkWinX.c: moved the initialization of tkPlatformId from
TkWinXInit to TkWinGetPlatformId because static builds could call
it before it was initialized. [Bug #427278]
FossilOrigin-Name: 0a94e34e9f35522faf20c96c321c2c998a26ba18
Diffstat (limited to 'win/tkWinX.c')
-rw-r--r-- | win/tkWinX.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c index 1b2c0e7..eab5ba4 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.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: tkWinX.c,v 1.12 2001/03/30 23:50:18 hobbs Exp $ + * RCS: @(#) $Id: tkWinX.c,v 1.13 2001/05/30 22:41:29 hobbs Exp $ */ #include "tkWinInt.h" @@ -29,7 +29,7 @@ static char winScreenName[] = ":0"; /* Default name of windows display. */ static HINSTANCE tkInstance; /* Application instance handle. */ static int childClassInitialized; /* Registered child class? */ static WNDCLASS childClass; /* Window class for child windows. */ -static int tkPlatformId; /* version of Windows platform */ +static int tkPlatformId = 0; /* version of Windows platform */ static Tcl_Encoding keyInputEncoding = NULL;/* The current character * encoding for keyboard input */ static int keyInputCharset = -1; /* The Win32 CHARSET for the keyboard @@ -137,8 +137,6 @@ void TkWinXInit(hInstance) HINSTANCE hInstance; { - OSVERSIONINFO os; - if (childClassInitialized != 0) { return; } @@ -146,10 +144,6 @@ TkWinXInit(hInstance) tkInstance = hInstance; - os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&os); - tkPlatformId = os.dwPlatformId; - /* * When threads are enabled, we cannot use CLASSDC because * threads will then write into the same device context. @@ -227,7 +221,7 @@ TkWinXCleanup(hInstance) * TkWinGetPlatformId -- * * Determines whether running under NT, 95, or Win32s, to allow - * runtime conditional code. + * runtime conditional code. Win32s is no longer supported. * * Results: * The return value is one of: @@ -244,6 +238,13 @@ TkWinXCleanup(hInstance) int TkWinGetPlatformId() { + if (tkPlatformId == 0) { + OSVERSIONINFO os; + + os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&os); + tkPlatformId = os.dwPlatformId; + } return tkPlatformId; } @@ -1198,7 +1199,7 @@ HandleIMEComposition(hwnd, lParam) char * buff; TkWindow *winPtr; - if (tkPlatformId != VER_PLATFORM_WIN32_NT) { + if (TkWinGetPlatformId() != VER_PLATFORM_WIN32_NT) { /* * The ImmGetCompositionStringW function works only on WinNT. */ |