From 9901c4812ae35bda160641378fab124f87238b96 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 4 Feb 2014 21:21:53 +0000 Subject: Add missing __stdcall (which crashes on win32), and clean-up indenting --- unix/tclUnixInit.c | 22 ++++++++++++---------- win/tclWinInit.c | 21 +++++++++++---------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 423e97e..11a65707 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -38,6 +38,7 @@ DLLIMPORT extern __stdcall void *LoadLibraryW(const void *); DLLIMPORT extern __stdcall void FreeLibrary(void *); DLLIMPORT extern __stdcall void *GetProcAddress(void *, const char *); DLLIMPORT extern __stdcall void GetSystemInfo(void *); +DLLIMPORT extern __stdcall void GetSystemInfo(void *); #define NUMPLATFORMS 4 static const char *const platforms[NUMPLATFORMS] = { @@ -929,16 +930,17 @@ TclpSetVariables( #ifdef __CYGWIN__ unameOK = 1; 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; + HANDLE handle = LoadLibraryW(L"NTDLL"); + __stdcall int(*getversion)(void *) = + (__stdcall int(*)(void *))GetProcAddress(handle, "RtlGetVersion"); + osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); + if (!getversion || getversion(&osInfo)) { + GetVersionExW(&osInfo); + } + if (handle) { + FreeLibrary(handle); + } + osInfoInitialized = 1; } GetSystemInfo(&sysInfo); diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 08ef1ed..f49edf0 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -573,16 +573,17 @@ TclpSetVariables( TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY); 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; + HANDLE handle = LoadLibraryW(L"NTDLL"); + __stdcall int(*getversion)(void *) = + (__stdcall int(*)(void *)) GetProcAddress(handle, "RtlGetVersion"); + osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); + if (!getversion || getversion(&osInfo)) { + GetVersionExW(&osInfo); + } + if (handle) { + FreeLibrary(handle); + } + osInfoInitialized = 1; } GetSystemInfo(&sys.info); -- cgit v0.12 From e11501e82c5daaf3f89f915d6df764823e9edb86 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 4 Feb 2014 21:29:44 +0000 Subject: remove duplicate declaration --- unix/tclUnixInit.c | 1 - 1 file changed, 1 deletion(-) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 11a65707..7e0b19a 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -38,7 +38,6 @@ DLLIMPORT extern __stdcall void *LoadLibraryW(const void *); DLLIMPORT extern __stdcall void FreeLibrary(void *); DLLIMPORT extern __stdcall void *GetProcAddress(void *, const char *); DLLIMPORT extern __stdcall void GetSystemInfo(void *); -DLLIMPORT extern __stdcall void GetSystemInfo(void *); #define NUMPLATFORMS 4 static const char *const platforms[NUMPLATFORMS] = { -- cgit v0.12