Import Tcl 8.6.11

This commit is contained in:
Steve Dower
2021-03-30 00:51:39 +01:00
parent 3bb8e3e086
commit 1aadb2455c
923 changed files with 79104 additions and 62616 deletions

View File

@@ -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");
}
}
@@ -210,11 +205,8 @@ 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)
* The return value is always:
* VER_PLATFORM_WIN32_NT Win32 on Windows NT, 2000, XP
* VER_PLATFORM_WIN32_CE Win32 on Windows CE
*
* Side effects:
* None.
@@ -225,7 +217,7 @@ TclWinInit(
int
TclWinGetPlatformId(void)
{
return platformId;
return VER_PLATFORM_WIN32_NT;
}
/*
@@ -259,37 +251,13 @@ TclWinNoBackslash(
return path;
}
/*
*---------------------------------------------------------------------------
*
* TclpSetInterfaces --
*
* A helper proc.
*
* Results:
* None.
*
* Side effects:
* None.
*
*---------------------------------------------------------------------------
*/
void
TclpSetInterfaces(void)
{
}
/*
*---------------------------------------------------------------------------
*
* TclWinEncodingsCleanup --
*
* Called during finalization to free up any encodings we use.
*
* We also clean up any memory allocated in our mount point map which is
* used to follow certain kinds of symlinks. That code should never be
* used once encodings are taken down.
* Called during finalization to clean up any memory allocated in our
* mount point map which is used to follow certain kinds of symlinks.
*
* Results:
* None.
@@ -446,7 +414,7 @@ TclWinDriveLetterForVolMountPoint(
* We couldn't find it, so we must iterate over the letters.
*/
for (drive[0] = L'A'; drive[0] <= L'Z'; drive[0]++) {
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) {
/*
* Try to read the volume mount point and see where it points.
*/
@@ -463,8 +431,8 @@ TclWinDriveLetterForVolMountPoint(
}
}
if (!alreadyStored) {
dlPtr2 = ckalloc(sizeof(MountPointMap));
dlPtr2->volumeName = TclNativeDupInternalRep(Target);
dlPtr2 = (MountPointMap *)ckalloc(sizeof(MountPointMap));
dlPtr2->volumeName = (WCHAR *)TclNativeDupInternalRep(Target);
dlPtr2->driveLetter = (char) drive[0];
dlPtr2->nextPtr = driveLetterLookup;
driveLetterLookup = dlPtr2;
@@ -489,8 +457,8 @@ TclWinDriveLetterForVolMountPoint(
* that fact and store '-1' so we don't have to look it up each time.
*/
dlPtr2 = ckalloc(sizeof(MountPointMap));
dlPtr2->volumeName = TclNativeDupInternalRep((ClientData) mountPoint);
dlPtr2 = (MountPointMap *)ckalloc(sizeof(MountPointMap));
dlPtr2->volumeName = (WCHAR *)TclNativeDupInternalRep((void *)mountPoint);
dlPtr2->driveLetter = -1;
dlPtr2->nextPtr = driveLetterLookup;
driveLetterLookup = dlPtr2;
@@ -717,7 +685,7 @@ TclWinCPUID(
"movl %%eax, 0x0(%%edi)" "\n\t"
"movl %%ebx, 0x4(%%edi)" "\n\t"
"movl %%ecx, 0x8(%%edi)" "\n\t"
"movl %%edx, 0xc(%%edi)" "\n\t"
"movl %%edx, 0xC(%%edi)" "\n\t"
:
/* No outputs */
@@ -749,7 +717,7 @@ TclWinCPUID(
"leal 1f, %%eax" "\n\t"
"movl %%eax, 0x4(%%edx)" "\n\t" /* handler */
"movl %%ebp, 0x8(%%edx)" "\n\t" /* ebp */
"movl %%esp, 0xc(%%edx)" "\n\t" /* esp */
"movl %%esp, 0xC(%%edx)" "\n\t" /* esp */
"movl %[error], 0x10(%%edx)" "\n\t" /* status */
/*
@@ -769,7 +737,7 @@ TclWinCPUID(
"movl %%eax, 0x0(%%edi)" "\n\t"
"movl %%ebx, 0x4(%%edi)" "\n\t"
"movl %%ecx, 0x8(%%edi)" "\n\t"
"movl %%edx, 0xc(%%edi)" "\n\t"
"movl %%edx, 0xC(%%edi)" "\n\t"
/*
* Come here on a normal exit. Recover the TCLEXCEPTION_REGISTRATION and
@@ -796,7 +764,7 @@ TclWinCPUID(
*/
"2:" "\t"
"movl 0xc(%%edx), %%esp" "\n\t"
"movl 0xC(%%edx), %%esp" "\n\t"
"movl 0x8(%%edx), %%ebp" "\n\t"
"movl 0x0(%%edx), %%eax" "\n\t"
"movl %%eax, %%fs:0" "\n\t"