summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-11-15 17:55:25 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-11-15 17:55:25 (GMT)
commit8a45c3faf392af5c64589268d0d7699c17b7feec (patch)
treea098b4e6b1d3b2a82e4d807dc53a33244eb57d2b /generic
parenta06d3694d5af51acabffa650a8aaaa30e199d130 (diff)
downloadtcl-8a45c3faf392af5c64589268d0d7699c17b7feec.zip
tcl-8a45c3faf392af5c64589268d0d7699c17b7feec.tar.gz
tcl-8a45c3faf392af5c64589268d0d7699c17b7feec.tar.bz2
More complete purge of things only present for supporting long-dead Mac 9 systems.
Diffstat (limited to 'generic')
-rw-r--r--generic/README4
-rw-r--r--generic/tcl.h45
-rw-r--r--generic/tclAlloc.c2
-rw-r--r--generic/tclBasic.c14
-rw-r--r--generic/tclCmdAH.c7
-rw-r--r--generic/tclDate.c12
-rw-r--r--generic/tclExecute.c2
-rw-r--r--generic/tclFileName.c579
-rw-r--r--generic/tclGet.c2
-rw-r--r--generic/tclGetDate.y12
-rw-r--r--generic/tclIOCmd.c16
-rw-r--r--generic/tclIOUtil.c53
-rw-r--r--generic/tclInt.h22
-rw-r--r--generic/tclMain.c4
-rw-r--r--generic/tclMath.h6
-rw-r--r--generic/tclNotify.c2
-rw-r--r--generic/tclPort.h6
-rw-r--r--generic/tclStubInit.c12
-rw-r--r--generic/tclTest.c7
-rw-r--r--generic/tclThreadJoin.c4
20 files changed, 27 insertions, 784 deletions
diff --git a/generic/README b/generic/README
index ec6139a..3311690 100644
--- a/generic/README
+++ b/generic/README
@@ -1,3 +1,3 @@
This directory contains Tcl source files that work on all the platforms
-where Tcl runs (e.g. UNIX, PCs, and Macintoshes). Platform-specific
-sources are in the directories ../unix, ../win, ../macosx, and ../mac.
+where Tcl runs (e.g. UNIX, PCs). Platform-specific
+sources are in the directories ../unix, ../win, and ../macosx.
diff --git a/generic/tcl.h b/generic/tcl.h
index 3c6ef5e..36077e6 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -90,23 +90,6 @@ extern "C" {
#endif /* __WIN32__ */
/*
- * The following definitions set up the proper options for Macintosh
- * compilers. We use this method because there is no autoconf equivalent.
- */
-
-#ifdef MAC_TCL
-#include <ConditionalMacros.h>
-# ifndef USE_TCLALLOC
-# define USE_TCLALLOC 1
-# endif
-# ifndef NO_STRERROR
-# define NO_STRERROR 1
-# endif
-# define INLINE
-#endif
-
-
-/*
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double
* quotation marks), JOIN joins two arguments.
*/
@@ -121,9 +104,8 @@ extern "C" {
/*
* A special definition used to allow this header file to be included
- * from windows or mac resource files so that they can obtain version
- * information. RC_INVOKED is defined by default by the windows RC tool
- * and manually set for macintosh.
+ * from windows resource files so that they can obtain version
+ * information. RC_INVOKED is defined by default by the windows RC tool.
*
* Resource compilers don't like all the C stuff, like typedefs and
* procedure declarations, that occur below, so block them out.
@@ -538,9 +520,7 @@ typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle;
* 'Tcl_CreateThread' and will be called as the main fuction of
* the new thread created by that call.
*/
-#ifdef MAC_TCL
-typedef pascal void *(Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
-#elif defined __WIN32__
+#if defined __WIN32__
typedef unsigned (__stdcall Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
#else
typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
@@ -551,10 +531,7 @@ typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
* differences when writing a Tcl_ThreadCreateProc. See the NewThread
* function in generic/tclThreadTest.c for it's usage.
*/
-#ifdef MAC_TCL
-# define Tcl_ThreadCreateType pascal void *
-# define TCL_THREAD_CREATE_RETURN return NULL
-#elif defined __WIN32__
+#ifdef __WIN32__
# define Tcl_ThreadCreateType unsigned __stdcall
# define TCL_THREAD_CREATE_RETURN return 0
#else
@@ -1433,7 +1410,6 @@ typedef enum {
* The following structure keeps is used to hold a time value, either as
* an absolute time (the number of seconds from the epoch) or as an
* elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
- * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT.
*/
typedef struct Tcl_Time {
@@ -2366,20 +2342,7 @@ EXTERN CONST char * Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp,
* accessible via the stubs table.
*/
-/*
- * tclPlatDecls.h can't be included here on the Mac, as we need
- * Mac specific headers to define the Mac types used in this file,
- * but these Mac haders conflict with a number of tk types
- * and thus can't be included in the globally read tcl.h
- * This header was originally added here as a fix for bug 5241
- * (stub link error for symbols in TclPlatStubs table), as a work-
- * around for the bug on the mac, tclMac.h is included immediately
- * after tcl.h in the tcl precompiled header (with DLLEXPORT set).
- */
-
-#if !defined(MAC_TCL)
#include "tclPlatDecls.h"
-#endif
/*
* Public functions that are not accessible via the stubs table.
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c
index 7b9c807..5967201 100644
--- a/generic/tclAlloc.c
+++ b/generic/tclAlloc.c
@@ -32,7 +32,7 @@
* We should really make use of AC_CHECK_TYPE(caddr_t)
* here, but it can wait until Tcl uses config.h properly.
*/
-#if defined(MAC_TCL) || defined(_MSC_VER) || defined(__MINGW32__) || defined(__BORLANDC__)
+#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__BORLANDC__)
typedef unsigned long caddr_t;
#endif
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index c738916..bd4ad5d 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -242,24 +242,10 @@ static CONST CmdInfo builtInCmds[] = {
(CompileProc *) NULL, 1},
{"vwait", (Tcl_CmdProc *) NULL, Tcl_VwaitObjCmd,
(CompileProc *) NULL, 1},
-
-#ifdef MAC_TCL
- {"beep", (Tcl_CmdProc *) NULL, Tcl_BeepObjCmd,
- (CompileProc *) NULL, 0},
- {"echo", Tcl_EchoCmd, (Tcl_ObjCmdProc *) NULL,
- (CompileProc *) NULL, 0},
- {"ls", (Tcl_CmdProc *) NULL, Tcl_LsObjCmd,
- (CompileProc *) NULL, 0},
- {"resource", (Tcl_CmdProc *) NULL, Tcl_ResourceObjCmd,
- (CompileProc *) NULL, 1},
- {"source", (Tcl_CmdProc *) NULL, Tcl_MacSourceObjCmd,
- (CompileProc *) NULL, 0},
-#else
{"exec", (Tcl_CmdProc *) NULL, Tcl_ExecObjCmd,
(CompileProc *) NULL, 0},
{"source", (Tcl_CmdProc *) NULL, Tcl_SourceObjCmd,
(CompileProc *) NULL, 0},
-#endif /* MAC_TCL */
#endif /* TCL_GENERIC_ONLY */
{NULL, (Tcl_CmdProc *) NULL, (Tcl_ObjCmdProc *) NULL,
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 45e138c..2f7814c 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -1168,11 +1168,11 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
value = 0;
if (GetStatBuf(NULL, objv[2], Tcl_FSStat, &buf) == TCL_OK) {
/*
- * For Windows and Macintosh, there are no user ids
+ * For Windows there are no user ids
* associated with a file, so we always return 1.
*/
-#if defined(__WIN32__) || defined(MAC_TCL) || defined(__CYGWIN__)
+#if defined(__WIN32__) || defined(__CYGWIN__)
value = 1;
#else
value = (geteuid() == buf.st_uid);
@@ -1262,9 +1262,6 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
case TCL_PLATFORM_WINDOWS:
separator = "\\";
break;
- case TCL_PLATFORM_MAC:
- separator = ":";
- break;
}
Tcl_SetObjResult(interp, Tcl_NewStringObj(separator,1));
} else {
diff --git a/generic/tclDate.c b/generic/tclDate.c
index b64a792..0475e58 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -14,15 +14,9 @@
#include "tclInt.h"
#include "tclPort.h"
-#if defined(MAC_TCL) && !defined(TCL_MAC_USE_MSL_EPOCH)
-# define EPOCH 1904
-# define START_OF_TIME 1904
-# define END_OF_TIME 2039
-#else
-# define EPOCH 1970
-# define START_OF_TIME 1902
-# define END_OF_TIME 2037
-#endif
+#define EPOCH 1970
+#define START_OF_TIME 1902
+#define END_OF_TIME 2037
/*
* The offset of tm_year of struct tm returned by localtime, gmtime, etc.
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 3ca1b63..2a9f8bb 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -16,7 +16,7 @@
#include "tclCompile.h"
#ifndef TCL_NO_MATH
-# include "tclMath.h"
+# include <math.h>
#endif
/*
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index c5ecf0f..046eaef 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -16,51 +16,9 @@
#include "tclPort.h"
#include "tclRegexp.h"
-/*
- * This define is used to activate Tcl's interpretation of Unix-style
- * paths (containing forward slashes, '.' and '..') on MacOS. A
- * side-effect of this is that some paths become ambiguous.
- */
-#define MAC_UNDERSTANDS_UNIX_PATHS
-
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
-/*
- * The following regular expression matches the root portion of a Macintosh
- * absolute path. It will match degenerate Unix-style paths, tilde paths,
- * Unix-style paths, and Mac paths. The various subexpressions in this
- * can be summarised as follows: ^(/..|~user/unix|~user:mac|/unix|mac:dir).
- * The subexpression indices which match the root portions, are as follows:
- *
- * degenerate unix-style: 2
- * unix-tilde: 5
- * mac-tilde: 7
- * unix-style: 9 (or 10 to cut off the irrelevant header).
- * mac: 12
- *
- */
-
-#define MAC_ROOT_PATTERN "^((/+([.][.]?/+)*([.][.]?)?)|(~[^:/]*)(/[^:]*)?|(~[^:]*)(:.*)?|/+([.][.]?/+)*([^:/]+)(/[^:]*)?|([^:]+):.*)$"
-
-/*
- * The following variables are used to hold precompiled regular expressions
- * for use in filename matching.
- */
-
-typedef struct ThreadSpecificData {
- int initialized;
- Tcl_Obj *macRootPatternPtr;
-} ThreadSpecificData;
-
-static Tcl_ThreadDataKey dataKey;
-
-static void FileNameCleanup _ANSI_ARGS_((ClientData clientData));
-static void FileNameInit _ANSI_ARGS_((void));
-
-#endif
-
/*
* The following variable is set in the TclPlatformInit call to one
- * of: TCL_PLATFORM_UNIX, TCL_PLATFORM_MAC, or TCL_PLATFORM_WINDOWS.
+ * of: TCL_PLATFORM_UNIX, or TCL_PLATFORM_WINDOWS.
*/
TclPlatformType tclPlatform = TCL_PLATFORM_UNIX;
@@ -76,64 +34,8 @@ static CONST char * ExtractWinRoot _ANSI_ARGS_((CONST char *path,
Tcl_PathType *typePtr));
static int SkipToChar _ANSI_ARGS_((char **stringPtr,
char *match));
-static Tcl_Obj* SplitMacPath _ANSI_ARGS_((CONST char *path));
static Tcl_Obj* SplitWinPath _ANSI_ARGS_((CONST char *path));
static Tcl_Obj* SplitUnixPath _ANSI_ARGS_((CONST char *path));
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
-
-/*
- *----------------------------------------------------------------------
- *
- * FileNameInit --
- *
- * This procedure initializes the patterns used by this module.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Compiles the regular expressions.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-FileNameInit()
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- if (!tsdPtr->initialized) {
- tsdPtr->initialized = 1;
- tsdPtr->macRootPatternPtr = Tcl_NewStringObj(MAC_ROOT_PATTERN, -1);
- Tcl_CreateThreadExitHandler(FileNameCleanup, NULL);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * FileNameCleanup --
- *
- * This procedure is a Tcl_ExitProc used to clean up the static
- * data structures used in this file.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Deallocates storage used by the procedures in this file.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-FileNameCleanup(clientData)
- ClientData clientData; /* Not used. */
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- Tcl_DecrRefCount(tsdPtr->macRootPatternPtr);
- tsdPtr->initialized = 0;
-}
-#endif
/*
*----------------------------------------------------------------------
@@ -411,87 +313,6 @@ TclpGetNativePathType(pathObjPtr, driveNameLengthPtr, driveNameRef)
}
break;
}
- case TCL_PLATFORM_MAC:
- if (path[0] == ':') {
- type = TCL_PATH_RELATIVE;
- } else {
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- ThreadSpecificData *tsdPtr;
- Tcl_RegExp re;
-
- tsdPtr = TCL_TSD_INIT(&dataKey);
-
- /*
- * Since we have eliminated the easy cases, use the
- * root pattern to look for the other types.
- */
-
- FileNameInit();
- re = Tcl_GetRegExpFromObj(NULL, tsdPtr->macRootPatternPtr,
- REG_ADVANCED);
-
- if (!Tcl_RegExpExec(NULL, re, path, path)) {
- type = TCL_PATH_RELATIVE;
- } else {
- CONST char *root, *end;
- Tcl_RegExpRange(re, 2, &root, &end);
- if (root != NULL) {
- type = TCL_PATH_RELATIVE;
- } else {
- if (driveNameLengthPtr != NULL) {
- Tcl_RegExpRange(re, 0, &root, &end);
- *driveNameLengthPtr = end - root;
- }
- if (driveNameRef != NULL) {
- if (*root == '/') {
- char *c;
- int gotColon = 0;
- *driveNameRef = Tcl_NewStringObj(root + 1,
- end - root -1);
- c = Tcl_GetString(*driveNameRef);
- while (*c != '\0') {
- if (*c == '/') {
- gotColon++;
- *c = ':';
- }
- c++;
- }
- /*
- * If there is no colon, we have just a
- * volume name so we must add a colon so
- * it is an absolute path.
- */
- if (gotColon == 0) {
- Tcl_AppendToObj(*driveNameRef, ":", 1);
- } else if ((gotColon > 1) &&
- (*(c-1) == ':')) {
- /* We have an extra colon */
- Tcl_SetObjLength(*driveNameRef,
- c - Tcl_GetString(*driveNameRef) - 1);
- }
- }
- }
- }
- }
-#else
- if (path[0] == '~') {
- } else if (path[0] == ':') {
- type = TCL_PATH_RELATIVE;
- } else {
- char *colonPos = strchr(path,':');
- if (colonPos == NULL) {
- type = TCL_PATH_RELATIVE;
- } else {
- }
- }
- if (type == TCL_PATH_ABSOLUTE) {
- if (driveNameLengthPtr != NULL) {
- *driveNameLengthPtr = strlen(path);
- }
- }
-#endif
- }
- break;
case TCL_PLATFORM_WINDOWS: {
Tcl_DString ds;
@@ -559,9 +380,6 @@ TclpNativeSplitPath(pathPtr, lenPtr)
resultPtr = SplitWinPath(Tcl_GetString(pathPtr));
break;
- case TCL_PLATFORM_MAC:
- resultPtr = SplitMacPath(Tcl_GetString(pathPtr));
- break;
}
/*
@@ -821,246 +639,6 @@ SplitWinPath(path)
}
/*
- *----------------------------------------------------------------------
- *
- * SplitMacPath --
- *
- * This routine is used by Tcl_(FS)SplitPath to handle splitting
- * Macintosh paths.
- *
- * Results:
- * Returns a newly allocated Tcl list object.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static Tcl_Obj*
-SplitMacPath(path)
- CONST char *path; /* Pointer to string containing a path. */
-{
- int isMac = 0; /* 1 if is Mac-style, 0 if Unix-style path. */
- int length;
- CONST char *p, *elementStart;
- Tcl_Obj *result;
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- Tcl_RegExp re;
- int i;
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-#endif
-
- result = Tcl_NewObj();
-
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- /*
- * Initialize the path name parser for Macintosh path names.
- */
-
- FileNameInit();
-
- /*
- * Match the root portion of a Mac path name.
- */
-
- i = 0; /* Needed only to prevent gcc warnings. */
-
- re = Tcl_GetRegExpFromObj(NULL, tsdPtr->macRootPatternPtr, REG_ADVANCED);
-
- if (Tcl_RegExpExec(NULL, re, path, path) == 1) {
- CONST char *start, *end;
- Tcl_Obj *nextElt;
-
- /*
- * Treat degenerate absolute paths like / and /../.. as
- * Mac relative file names for lack of anything else to do.
- */
-
- Tcl_RegExpRange(re, 2, &start, &end);
- if (start) {
- Tcl_Obj *elt = Tcl_NewStringObj(":", 1);
- Tcl_RegExpRange(re, 0, &start, &end);
- Tcl_AppendToObj(elt, path, end - start);
- Tcl_ListObjAppendElement(NULL, result, elt);
- return result;
- }
-
- Tcl_RegExpRange(re, 5, &start, &end);
- if (start) {
- /*
- * Unix-style tilde prefixed paths.
- */
-
- isMac = 0;
- i = 5;
- } else {
- Tcl_RegExpRange(re, 7, &start, &end);
- if (start) {
- /*
- * Mac-style tilde prefixed paths.
- */
-
- isMac = 1;
- i = 7;
- } else {
- Tcl_RegExpRange(re, 10, &start, &end);
- if (start) {
- /*
- * Normal Unix style paths.
- */
-
- isMac = 0;
- i = 10;
- } else {
- Tcl_RegExpRange(re, 12, &start, &end);
- if (start) {
- /*
- * Normal Mac style paths.
- */
-
- isMac = 1;
- i = 12;
- }
- }
- }
- }
- Tcl_RegExpRange(re, i, &start, &end);
- length = end - start;
-
- /*
- * Append the element and terminate it with a :
- */
-
- nextElt = Tcl_NewStringObj(start, length);
- Tcl_AppendToObj(nextElt, ":", 1);
- Tcl_ListObjAppendElement(NULL, result, nextElt);
- p = end;
- } else {
- isMac = (strchr(path, ':') != NULL);
- p = path;
- }
-#else
- if ((path[0] != ':') && (path[0] == '~' || (strchr(path,':') != NULL))) {
- CONST char *end;
- Tcl_Obj *nextElt;
-
- isMac = 1;
-
- end = strchr(path,':');
- if (end == NULL) {
- length = strlen(path);
- } else {
- length = end - path;
- }
-
- /*
- * Append the element and terminate it with a :
- */
-
- nextElt = Tcl_NewStringObj(path, length);
- Tcl_AppendToObj(nextElt, ":", 1);
- Tcl_ListObjAppendElement(NULL, result, nextElt);
- p = path + length;
- } else {
- isMac = (strchr(path, ':') != NULL);
- isMac = 1;
- p = path;
- }
-#endif
-
- if (isMac) {
-
- /*
- * p is pointing at the first colon in the path. There
- * will always be one, since this is a Mac-style path.
- * (This is no longer true if MAC_UNDERSTANDS_UNIX_PATHS
- * is false, so we must check whether 'p' points to the
- * end of the string.)
- */
- elementStart = p;
- if (*p == ':') {
- p++;
- }
-
- while ((p = strchr(p, ':')) != NULL) {
- length = p - elementStart;
- if (length == 1) {
- while (*p == ':') {
- Tcl_ListObjAppendElement(NULL, result,
- Tcl_NewStringObj("::", 2));
- elementStart = p++;
- }
- } else {
- /*
- * If this is a simple component, drop the leading colon.
- */
-
- if ((elementStart[1] != '~')
- && (strchr(elementStart+1, '/') == NULL)) {
- elementStart++;
- length--;
- }
- Tcl_ListObjAppendElement(NULL, result,
- Tcl_NewStringObj(elementStart, length));
- elementStart = p++;
- }
- }
- if (elementStart[0] != ':') {
- if (elementStart[0] != '\0') {
- Tcl_ListObjAppendElement(NULL, result,
- Tcl_NewStringObj(elementStart, -1));
- }
- } else {
- if (elementStart[1] != '\0' || elementStart == path) {
- if ((elementStart[1] != '~') && (elementStart[1] != '\0')
- && (strchr(elementStart+1, '/') == NULL)) {
- elementStart++;
- }
- Tcl_ListObjAppendElement(NULL, result,
- Tcl_NewStringObj(elementStart, -1));
- }
- }
- } else {
-
- /*
- * Split on slashes, suppress extra /'s, and convert .. to ::.
- */
-
- for (;;) {
- elementStart = p;
- while ((*p != '\0') && (*p != '/')) {
- p++;
- }
- length = p - elementStart;
- if (length > 0) {
- if ((length == 1) && (elementStart[0] == '.')) {
- Tcl_ListObjAppendElement(NULL, result,
- Tcl_NewStringObj(":", 1));
- } else if ((length == 2) && (elementStart[0] == '.')
- && (elementStart[1] == '.')) {
- Tcl_ListObjAppendElement(NULL, result,
- Tcl_NewStringObj("::", 2));
- } else {
- Tcl_Obj *nextElt;
- if (*elementStart == '~') {
- nextElt = Tcl_NewStringObj(":",1);
- Tcl_AppendToObj(nextElt, elementStart, length);
- } else {
- nextElt = Tcl_NewStringObj(elementStart, length);
- }
- Tcl_ListObjAppendElement(NULL, result, nextElt);
- }
- }
- if (*p++ == '\0') {
- break;
- }
- }
- }
- return result;
-}
-
-/*
*---------------------------------------------------------------------------
*
* Tcl_FSJoinToPath --
@@ -1222,85 +800,6 @@ TclpNativeJoinPath(prefix, joining)
Tcl_SetObjLength(prefix, length);
break;
- case TCL_PLATFORM_MAC: {
- int newLength;
-
- /*
- * Sort out separators. We basically add the object we've
- * been given, but we have to make sure that there is
- * exactly one separator inbetween (unless the object we're
- * adding contains multiple contiguous colons, all of which
- * we must add). Also if an object is just ':' we don't
- * bother to add it unless it's the very first element.
- */
-
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- int adjustedPath = 0;
- if ((strchr(p, ':') == NULL) && (strchr(p, '/') != NULL)) {
- char *start = p;
- adjustedPath = 1;
- while (*start != '\0') {
- if (*start == '/') {
- *start = ':';
- }
- start++;
- }
- }
-#endif
- if (length > 0) {
- if ((p[0] == ':') && (p[1] == '\0')) {
- return;
- }
- if (start[length-1] != ':') {
- if (*p != '\0' && *p != ':') {
- Tcl_AppendToObj(prefix, ":", 1);
- length++;
- }
- } else if (*p == ':') {
- p++;
- }
- } else {
- if (*p != '\0' && *p != ':') {
- Tcl_AppendToObj(prefix, ":", 1);
- length++;
- }
- }
-
- /*
- * Append the element
- */
-
- newLength = strlen(p);
- /*
- * It may not be good to just do 'Tcl_AppendToObj(prefix,
- * p, newLength)' because the object may contain duplicate
- * colons which we want to get rid of.
- */
- Tcl_AppendToObj(prefix, p, newLength);
-
- /* Remove spurious trailing single ':' */
- dest = Tcl_GetString(prefix) + length + newLength;
- if (*(dest-1) == ':') {
- if (dest-1 > Tcl_GetString(prefix)) {
- if (*(dest-2) != ':') {
- Tcl_SetObjLength(prefix, length + newLength -1);
- }
- }
- }
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- /* Revert the path to what it was */
- if (adjustedPath) {
- char *start = joining;
- while (*start != '\0') {
- if (*start == ':') {
- *start = '/';
- }
- start++;
- }
- }
-#endif
- break;
- }
}
return;
}
@@ -1459,18 +958,6 @@ TclGetExtension(name)
lastSep = strrchr(name, '/');
break;
- case TCL_PLATFORM_MAC:
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- if (strchr(name, ':') == NULL) {
- lastSep = strrchr(name, '/');
- } else {
- lastSep = strrchr(name, ':');
- }
-#else
- lastSep = strrchr(name, ':');
-#endif
- break;
-
case TCL_PLATFORM_WINDOWS:
lastSep = NULL;
for (p = name; *p != '\0'; p++) {
@@ -1699,9 +1186,6 @@ Tcl_GlobObjCmd(dummy, interp, objc, objv)
case TCL_PLATFORM_WINDOWS:
separators = "/\\:";
break;
- case TCL_PLATFORM_MAC:
- separators = ":";
- break;
}
if (dir == PATH_GENERAL) {
int pathlength;
@@ -2040,17 +1524,6 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types)
case TCL_PLATFORM_WINDOWS:
separators = "/\\:";
break;
- case TCL_PLATFORM_MAC:
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- if (unquotedPrefix == NULL) {
- separators = (strchr(pattern, ':') == NULL) ? "/" : ":";
- } else {
- separators = ":";
- }
-#else
- separators = ":";
-#endif
- break;
}
Tcl_DStringInit(&buffer);
@@ -2183,16 +1656,6 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types)
Tcl_ListObjGetElements(NULL, Tcl_GetObjResult(interp),
&objc, &objv);
-#ifdef MAC_TCL
- /* adjust prefixLen if TclDoGlob prepended a ':' */
- if ((prefixLen > 0) && (objc > 0)
- && (Tcl_DStringValue(&buffer)[0] != ':')) {
- char *str = Tcl_GetStringFromObj(objv[0],NULL);
- if (str[0] == ':') {
- prefixLen++;
- }
- }
-#endif
for (i = 0; i< objc; i++) {
Tcl_Obj* elt;
if (globFlags & TCL_GLOBMODE_TAILS) {
@@ -2353,13 +1816,11 @@ TclDoGlob(interp, separators, headPtr, tail, types)
} else if (strchr(separators, *tail) == NULL) {
break;
}
- if (tclPlatform != TCL_PLATFORM_MAC) {
if (*tail == '\\') {
Tcl_DStringAppend(headPtr, separators, 1);
} else {
Tcl_DStringAppend(headPtr, tail, 1);
}
- }
count++;
}
@@ -2370,31 +1831,6 @@ TclDoGlob(interp, separators, headPtr, tail, types)
*/
switch (tclPlatform) {
- case TCL_PLATFORM_MAC:
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- if (*separators == '/') {
- if (((length == 0) && (count == 0))
- || ((length > 0) && (lastChar != ':'))) {
- Tcl_DStringAppend(headPtr, ":", 1);
- }
- } else {
-#endif
- if (count == 0) {
- if ((length > 0) && (lastChar != ':')) {
- Tcl_DStringAppend(headPtr, ":", 1);
- }
- } else {
- if (lastChar == ':') {
- count--;
- }
- while (count-- > 0) {
- Tcl_DStringAppend(headPtr, ":", 1);
- }
- }
-#ifdef MAC_UNDERSTANDS_UNIX_PATHS
- }
-#endif
- break;
case TCL_PLATFORM_WINDOWS:
/*
* If this is a drive relative path, add the colon and the
@@ -2575,11 +2011,7 @@ TclDoGlob(interp, separators, headPtr, tail, types)
Tcl_DStringAppend(&ds, "./", 2);
}
Tcl_DStringAppend(&ds, Tcl_GetString(elt), -1);
- if(tclPlatform == TCL_PLATFORM_MAC) {
- Tcl_DStringAppend(&ds, ":",1);
- } else {
Tcl_DStringAppend(&ds, "/",1);
- }
ret = TclDoGlob(interp, separators, &ds, p+1, types);
Tcl_DStringFree(&ds);
if (ret != TCL_OK) {
@@ -2630,12 +2062,6 @@ TclDoGlob(interp, separators, headPtr, tail, types)
Tcl_Obj *nameObj;
switch (tclPlatform) {
- case TCL_PLATFORM_MAC: {
- if (strchr(Tcl_DStringValue(headPtr), ':') == NULL) {
- Tcl_DStringAppend(headPtr, ":", 1);
- }
- break;
- }
case TCL_PLATFORM_WINDOWS: {
if (Tcl_DStringLength(headPtr) == 0) {
if (((*name == '\\') && (name[1] == '/' || name[1] == '\\'))
@@ -2737,8 +2163,7 @@ TclFileDirname(interp, pathPtr)
splitResultPtr = Tcl_FSJoinPath(splitPtr, splitElements - 1);
} else if (splitElements == 0 ||
(Tcl_FSGetPathType(pathPtr) == TCL_PATH_RELATIVE)) {
- splitResultPtr = Tcl_NewStringObj(
- ((tclPlatform == TCL_PLATFORM_MAC) ? ":" : "."), 1);
+ splitResultPtr = Tcl_NewStringObj(".", 1);
} else {
Tcl_ListObjIndex(NULL, splitPtr, 0, &splitResultPtr);
}
diff --git a/generic/tclGet.c b/generic/tclGet.c
index b15f100..c16da0d 100644
--- a/generic/tclGet.c
+++ b/generic/tclGet.c
@@ -14,7 +14,7 @@
#include "tclInt.h"
#include "tclPort.h"
-#include "tclMath.h"
+#include <math.h>
/*
diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y
index d210526..52a5052 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -31,15 +31,9 @@
#include "tclInt.h"
#include "tclPort.h"
-#if defined(MAC_TCL) && !defined(TCL_MAC_USE_MSL_EPOCH)
-# define EPOCH 1904
-# define START_OF_TIME 1904
-# define END_OF_TIME 2039
-#else
-# define EPOCH 1970
-# define START_OF_TIME 1902
-# define END_OF_TIME 2037
-#endif
+#define EPOCH 1970
+#define START_OF_TIME 1902
+#define END_OF_TIME 2037
/*
* The offset of tm_year of struct tm returned by localtime, gmtime, etc.
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 2b3a5a8..635490c 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -706,14 +706,6 @@ Tcl_ExecObjCmd(dummy, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
-#ifdef MAC_TCL
-
- Tcl_AppendResult(interp, "exec not implemented under Mac OS",
- (char *)NULL);
- return TCL_ERROR;
-
-#else /* !MAC_TCL */
-
/*
* This procedure generates an argv array for the string arguments. It
* starts out with stack-allocated space but uses dynamically-allocated
@@ -854,7 +846,6 @@ Tcl_ExecObjCmd(dummy, interp, objc, objv)
Tcl_SetObjResult(interp, resultPtr);
return result;
-#endif /* !MAC_TCL */
}
/*
@@ -965,12 +956,6 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv)
if (!pipeline) {
chan = Tcl_FSOpenFileChannel(interp, objv[1], modeString, prot);
} else {
-#ifdef MAC_TCL
- Tcl_AppendResult(interp,
- "command pipelines not supported on Macintosh OS",
- (char *)NULL);
- return TCL_ERROR;
-#else
int mode, seekFlag, cmdObjc;
CONST char **cmdArgv;
@@ -1000,7 +985,6 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv)
chan = Tcl_OpenCommandChannel(interp, cmdObjc, cmdArgv, flags);
}
ckfree((char *) cmdArgv);
-#endif
}
if (chan == (Tcl_Channel) NULL) {
return TCL_ERROR;
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index cfa01f0..105c038 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -26,9 +26,6 @@
#include <sys/stat.h>
#include "tclInt.h"
#include "tclPort.h"
-#ifdef MAC_TCL
-#include "tclMacInt.h"
-#endif
#ifdef __WIN32__
/* for tclWinProcs->useWide */
#include "tclWinInt.h"
@@ -2907,7 +2904,7 @@ Tcl_FSLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr,
FsDivertLoad *tvdlPtr;
int retVal;
-#if !defined(__WIN32__) && !defined(MAC_TCL)
+#if !defined(__WIN32__)
/*
* Do we need to set appropriate permissions
* on the file? This may be required on some
@@ -4292,9 +4289,6 @@ NativeFilesystemSeparator(pathObjPtr)
case TCL_PLATFORM_WINDOWS:
separator = "\\";
break;
- case TCL_PLATFORM_MAC:
- separator = ":";
- break;
}
return Tcl_NewStringObj(separator,1);
}
@@ -4912,11 +4906,6 @@ Tcl_FSJoinPath(listObj, elements)
Tcl_DecrRefCount(res);
return tail;
}
- } else if (tclPlatform == TCL_PLATFORM_MAC) {
- if (strchr(str, '/') == NULL) {
- Tcl_DecrRefCount(res);
- return tail;
- }
}
}
}
@@ -5066,7 +5055,6 @@ FindSplitPos(path, separator)
int count = 0;
switch (tclPlatform) {
case TCL_PLATFORM_UNIX:
- case TCL_PLATFORM_MAC:
while (path[count] != 0) {
if (path[count] == *separator) {
return count;
@@ -5121,18 +5109,6 @@ TclNewFSPathObj(Tcl_Obj *dirPtr, CONST char *addStrRep, int len)
objPtr = Tcl_NewObj();
fsPathPtr = (FsPath*)ckalloc((unsigned)sizeof(FsPath));
- if (tclPlatform == TCL_PLATFORM_MAC) {
- /*
- * Mac relative paths may begin with a directory separator ':'.
- * If present, we need to skip this ':' because we assume that
- * we can join dirPtr and addStrRep by concatenating them as
- * strings (and we ensure that dirPtr is terminated by a ':').
- */
- if (addStrRep[0] == ':') {
- addStrRep++;
- len--;
- }
- }
/* Setup the path */
fsPathPtr->translatedPathPtr = NULL;
fsPathPtr->normPathPtr = Tcl_NewStringObj(addStrRep, len);
@@ -5312,11 +5288,6 @@ TclFSMakePathRelative(interp, objPtr, cwdPtr)
cwdLen++;
}
break;
- case TCL_PLATFORM_MAC:
- if (tempStr[cwdLen-1] != ':') {
- cwdLen++;
- }
- break;
}
tempStr = Tcl_GetStringFromObj(objPtr, &len);
@@ -5645,12 +5616,6 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr)
cwdLen++;
}
break;
- case TCL_PLATFORM_MAC:
- if (cwdStr[cwdLen-1] != ':') {
- Tcl_AppendToObj(copy, ":", 1);
- cwdLen++;
- }
- break;
}
Tcl_AppendObjToObj(copy, fsPathPtr->normPathPtr);
@@ -5748,12 +5713,6 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr)
cwdLen++;
}
break;
- case TCL_PLATFORM_MAC:
- if (cwdStr[cwdLen-1] != ':') {
- Tcl_AppendToObj(copy, ":", 1);
- cwdLen++;
- }
- break;
}
Tcl_AppendObjToObj(copy, pathObjPtr);
/*
@@ -6184,10 +6143,6 @@ SetFsPathFromAny(interp, objPtr)
int split;
char separator='/';
- if (tclPlatform==TCL_PLATFORM_MAC) {
- if (strchr(name, ':') != NULL) separator = ':';
- }
-
split = FindSplitPos(name, &separator);
if (split != len) {
/* We have multiple pieces '~user/foo/bar...' */
@@ -6453,12 +6408,6 @@ UpdateStringOfFsPath(objPtr)
}
}
break;
- case TCL_PLATFORM_MAC:
- if (cwdStr[cwdLen-1] != ':') {
- Tcl_AppendToObj(copy, ":", 1);
- cwdLen++;
- }
- break;
}
Tcl_AppendObjToObj(copy, fsPathPtr->normPathPtr);
objPtr->bytes = Tcl_GetStringFromObj(copy, &cwdLen);
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 20c1155..a9a876e 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -1694,8 +1694,7 @@ typedef struct Interp {
typedef enum {
TCL_PLATFORM_UNIX, /* Any Unix-like OS. */
- TCL_PLATFORM_MAC, /* MacOS. */
- TCL_PLATFORM_WINDOWS /* Any Microsoft Windows OS. */
+ TCL_PLATFORM_WINDOWS=2 /* Any Microsoft Windows OS. */
} TclPlatformType;
/*
@@ -2295,25 +2294,6 @@ EXTERN int Tcl_WhileObjCmd _ANSI_ARGS_((ClientData clientData,
/*
*----------------------------------------------------------------
- * Command procedures found only in the Mac version of the core:
- *----------------------------------------------------------------
- */
-
-#ifdef MAC_TCL
-EXTERN int Tcl_EchoCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, CONST84 char **argv));
-EXTERN int Tcl_LsObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-EXTERN int Tcl_BeepObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-EXTERN int Tcl_MacSourceObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-EXTERN int Tcl_ResourceObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-#endif
-
-/*
- *----------------------------------------------------------------
* Compilation procedures for commands in the generic core:
*----------------------------------------------------------------
*/
diff --git a/generic/tclMain.c b/generic/tclMain.c
index 8252170..28a3dab 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -23,11 +23,7 @@
* the Tcl source directory to make their own modified versions).
*/
-#if !defined(MAC_TCL)
extern int isatty _ANSI_ARGS_((int fd));
-#else
-#include <unistd.h>
-#endif
static Tcl_Obj *tclStartupScriptPath = NULL;
diff --git a/generic/tclMath.h b/generic/tclMath.h
index 7492af0..0f02855 100644
--- a/generic/tclMath.h
+++ b/generic/tclMath.h
@@ -16,10 +16,6 @@
#ifndef _TCLMATH
#define _TCLMATH
-#if defined(MAC_TCL)
-# include "tclMacMath.h"
-#else
-# include <math.h>
-#endif
+#include <math.h>
#endif /* _TCLMATH */
diff --git a/generic/tclNotify.c b/generic/tclNotify.c
index bf82f1c..1f5a607 100644
--- a/generic/tclNotify.c
+++ b/generic/tclNotify.c
@@ -213,7 +213,7 @@ void
Tcl_SetNotifier(notifierProcPtr)
Tcl_NotifierProcs *notifierProcPtr;
{
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+#if !defined(__WIN32__) /* UNIX */
tclStubs.tcl_CreateFileHandler = notifierProcPtr->createFileHandlerProc;
tclStubs.tcl_DeleteFileHandler = notifierProcPtr->deleteFileHandlerProc;
#endif
diff --git a/generic/tclPort.h b/generic/tclPort.h
index f4fb831..c5d8b71 100644
--- a/generic/tclPort.h
+++ b/generic/tclPort.h
@@ -19,11 +19,7 @@
#if defined(__WIN32__)
# include "tclWinPort.h"
#else
-# if defined(MAC_TCL)
-# include "tclMacPort.h"
-# else
-# include "tclUnixPort.h"
-# endif
+# include "tclUnixPort.h"
#endif
#if !defined(LLONG_MIN)
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 2eb2351..c601256 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -44,7 +44,7 @@
Tcl_NotifierProcs tclOriginalNotifier = {
Tcl_SetTimer,
Tcl_WaitForEvent,
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+#if !defined(__WIN32__) /* UNIX */
Tcl_CreateFileHandler,
Tcl_DeleteFileHandler,
#else
@@ -194,16 +194,6 @@ Tcl_WinTCharToUtf(
# define TclpGmtime_unix TclpGmtime
#endif
-#ifdef MAC_TCL
-#define Tcl_DetachPids 0
-#define Tcl_OpenCommandChannel 0
-#define Tcl_ReapDetachedProcs 0
-#define TclCleanupChildren 0
-#define TclCreatePipeline 0
-#define TclSockMinimumBuffersOld 0
-#define TclSockMinimumBuffers 0
-#endif
-
/*
* WARNING: The contents of this file is automatically generated by the
* tools/genStubs.tcl script. Any modifications to the function declarations
diff --git a/generic/tclTest.c b/generic/tclTest.c
index e3fe579..51051bd 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -3757,8 +3757,6 @@ TestsetplatformCmd(clientData, interp, argc, argv)
length = strlen(argv[1]);
if (strncmp(argv[1], "unix", length) == 0) {
*platform = TCL_PLATFORM_UNIX;
- } else if (strncmp(argv[1], "mac", length) == 0) {
- *platform = TCL_PLATFORM_MAC;
} else if (strncmp(argv[1], "windows", length) == 0) {
*platform = TCL_PLATFORM_WINDOWS;
} else {
@@ -4825,11 +4823,6 @@ static int PretendTclpStat(path, buf)
#endif /* TCL_WIDE_INT_IS_LONG */
}
-/* Be careful in the compares in these tests, since the Macintosh puts a
- * leading : in the beginning of non-absolute paths before passing them
- * into the file command procedures.
- */
-
static int
TestStatProc1(path, buf)
CONST char *path;
diff --git a/generic/tclThreadJoin.c b/generic/tclThreadJoin.c
index f3c6abd..f097924 100644
--- a/generic/tclThreadJoin.c
+++ b/generic/tclThreadJoin.c
@@ -14,7 +14,7 @@
#include "tclInt.h"
-#if defined(WIN32) || defined(MAC_TCL)
+#if defined(WIN32)
/* The information about each joinable thread is remembered in a
* structure as defined below.
@@ -306,4 +306,4 @@ TclSignalExitThread(id,result)
Tcl_MutexUnlock (&threadPtr->threadMutex);
}
-#endif /* WIN32 || MAC_TCL */
+#endif /* WIN32 */