From 9215c2610ca2f4938aa0947bcbd1ecd19a8e5009 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 21 Nov 2017 14:59:04 +0000 Subject: Drop Windows CE support, since it doesn't appear to work anyway. --- generic/tclIntPlatDecls.h | 2 ++ generic/tclStubInit.c | 2 -- win/tclWin32Dll.c | 24 ++++++++---------------- win/tclWinInit.c | 12 ++---------- win/tclWinInt.h | 13 ------------- win/tclWinPipe.c | 45 ++++++++++++++------------------------------- 6 files changed, 26 insertions(+), 72 deletions(-) diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index ac06787..5003323 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -559,6 +559,8 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; # define TclWinGetServByName getservbyname # define TclWinGetSockOpt getsockopt # define TclWinSetSockOpt setsockopt +# undef TclWinGetPlatformId +# define TclWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */ #else # undef TclpGetPid # define TclpGetPid(pid) ((unsigned long) (pid)) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index b185f04..465dacc 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -118,8 +118,6 @@ TclpIsAtty(int fd) static int TclWinGetPlatformId() { - /* Don't bother to determine the real platform on cygwin, - * because VER_PLATFORM_WIN32_NT is the only supported platform */ return 2; /* VER_PLATFORM_WIN32_NT */; } diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 84c7a97..e482869 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -23,7 +23,6 @@ */ static HINSTANCE hInstance; /* HINSTANCE of this DLL. */ -static int platformId; /* Running under NT, or 95/98? */ /* * VC++ 5.x has no 'cpuid' assembler instruction, so we must emulate it @@ -186,18 +185,14 @@ TclWinInit( hInstance = hInst; os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&os); - platformId = os.dwPlatformId; /* - * We no longer support Win32s or Win9x, so just in case someone manages - * to get a runtime there, make sure they know that. + * We no longer support Win32s or Win9x or Windows CE, so just in case + * someone manages to get a runtime there, make sure they know that. */ - if (platformId == VER_PLATFORM_WIN32s) { - Tcl_Panic("Win32s is not a supported platform"); - } - if (platformId == VER_PLATFORM_WIN32_WINDOWS) { - Tcl_Panic("Windows 9x is not a supported platform"); + if (os.dwPlatformId != VER_PLATFORM_WIN32_NT) { + Tcl_Panic("Windows NT is the only supported platform"); } TclWinResetInterfaces(); @@ -212,22 +207,19 @@ TclWinInit( * conditional code. * * Results: - * The return value is one of: - * VER_PLATFORM_WIN32s Win32s on Windows 3.1 (not supported) - * VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95, 98, ME (not supported) - * VER_PLATFORM_WIN32_NT Win32 on Windows NT, 2000, XP - * VER_PLATFORM_WIN32_CE Win32 on Windows CE + * The return value is: + * VER_PLATFORM_WIN32_NT Win32 on Windows NT, 2000, XP, 7, 8, 8.1, 10 * * Side effects: * None. * *---------------------------------------------------------------------- */ - +#undef TclWinGetPlatformId int TclWinGetPlatformId(void) { - return platformId; + return VER_PLATFORM_WIN32_NT; } /* diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 98c7ed5..ec5582c 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -84,15 +84,10 @@ TclWinProcs tclWinProcs; /* * The following arrays contain the human readable strings for the Windows - * platform and processor values. + * processor values. */ -#define NUMPLATFORMS 4 -static const char *const platforms[NUMPLATFORMS] = { - "Win32s", "Windows 95", "Windows NT", "Windows CE" -}; - #define NUMPROCESSORS 11 static const char *const processors[NUMPROCESSORS] = { "intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil", @@ -568,10 +563,7 @@ TclpSetVariables( Tcl_SetVar2(interp, "tcl_platform", "platform", "windows", TCL_GLOBAL_ONLY); - if (osInfo.dwPlatformId < NUMPLATFORMS) { - Tcl_SetVar2(interp, "tcl_platform", "os", - platforms[osInfo.dwPlatformId], TCL_GLOBAL_ONLY); - } + Tcl_SetVar2(interp, "tcl_platform", "os", "Windows NT", TCL_GLOBAL_ONLY); wsprintfA(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion); Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY); if (sys.oemId.wProcessorArchitecture < NUMPROCESSORS) { diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 43799d0..d72cc43 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -40,19 +40,6 @@ typedef struct TclWinProcs { MODULE_SCOPE TclWinProcs tclWinProcs; -/* - * Some versions of Borland C have a define for the OSVERSIONINFO for - * Win32s and for NT, but not for Windows 95. - * Define VER_PLATFORM_WIN32_CE for those without newer headers. - */ - -#ifndef VER_PLATFORM_WIN32_WINDOWS -#define VER_PLATFORM_WIN32_WINDOWS 1 -#endif -#ifndef VER_PLATFORM_WIN32_CE -#define VER_PLATFORM_WIN32_CE 3 -#endif - #ifdef _WIN64 # define TCL_I_MODIFIER "I" #else diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 4b372a5..b4812ee 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -1095,40 +1095,23 @@ TclpCreateProcess( * detached processes. The GUI window will still pop up to the foreground. */ - if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { - if (HasConsole()) { + if (HasConsole()) { createFlags = 0; - } else if (applType == APPL_DOS) { - /* - * Under NT, 16-bit DOS applications will not run unless they can - * be attached to a console. If we are running without a console, - * run the 16-bit program as an normal process inside of a hidden - * console application, and then run that hidden console as a - * detached process. - */ + } else if (applType == APPL_DOS) { + /* + * Under NT, 16-bit DOS applications will not run unless they can + * be attached to a console. If we are running without a console, + * run the 16-bit program as an normal process inside of a hidden + * console application, and then run that hidden console as a + * detached process. + */ - startInfo.wShowWindow = SW_HIDE; - startInfo.dwFlags |= STARTF_USESHOWWINDOW; - createFlags = CREATE_NEW_CONSOLE; - TclDStringAppendLiteral(&cmdLine, "cmd.exe /c"); - } else { - createFlags = DETACHED_PROCESS; - } + startInfo.wShowWindow = SW_HIDE; + startInfo.dwFlags |= STARTF_USESHOWWINDOW; + createFlags = CREATE_NEW_CONSOLE; + TclDStringAppendLiteral(&cmdLine, "cmd.exe /c"); } else { - if (HasConsole()) { - createFlags = 0; - } else { - createFlags = DETACHED_PROCESS; - } - - if (applType == APPL_DOS) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "DOS application process not supported on this platform", - -1)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "DOS_APP", - NULL); - goto end; - } + createFlags = DETACHED_PROCESS; } /* -- cgit v0.12