summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2014-02-04 21:21:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2014-02-04 21:21:53 (GMT)
commit876dd3ac964025a81a9dc07a1006242bb4fc7256 (patch)
treed04ea85bcb30f3e9aeff79e22a534f71b31ed096
parent1eb2dfe0fc7e85021cb01445c281c92e891dd0c4 (diff)
downloadtcl-876dd3ac964025a81a9dc07a1006242bb4fc7256.zip
tcl-876dd3ac964025a81a9dc07a1006242bb4fc7256.tar.gz
tcl-876dd3ac964025a81a9dc07a1006242bb4fc7256.tar.bz2
Add missing __stdcall (which crashes on win32), and clean-up indenting
-rw-r--r--unix/tclUnixInit.c22
-rw-r--r--win/tclWinInit.c21
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);