]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Getting rid of support for the ancient Apple MPW compiler.
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 19 Nov 2003 15:24:47 +0000 (15:24 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 19 Nov 2003 15:24:47 +0000 (15:24 +0000)
Mac/Modules/macosmodule.c
Modules/main.c
Modules/mathmodule.c
Objects/object.c
Parser/acceler.c
Parser/myreadline.c
Python/modsupport.c
Python/mystrtoul.c
Python/pythonrun.c
Python/traceback.c

index 6790418b9619758997ce9e98d00472d43b8e5c4c..3217f86e6b848429e56247b3f52c772a57bd7b39 100644 (file)
@@ -47,10 +47,6 @@ static PyObject *MacOS_Error; /* Exception MacOS.Error */
 #define PATHNAMELEN 256
 #endif
 
-#ifdef MPW
-#define bufferIsSmall -607     /*error returns from Post and Accept */
-#endif
-
 /* ----------------------------------------------------- */
 
 /* Declarations for objects of type Resource fork */
@@ -778,4 +774,3 @@ initMacOS(void)
                return;
 
 }
-
index 91818e0df74b51a6b04164bb7009e9a688e670ea..68a82c7be372f499870ae32a995633700ec35f2b 100644 (file)
@@ -327,7 +327,6 @@ Py_Main(int argc, char **argv)
                _setmode(fileno(stdin), O_BINARY);
                _setmode(fileno(stdout), O_BINARY);
 #endif
-#ifndef MPW
 #ifdef HAVE_SETVBUF
                setvbuf(stdin,  (char *)NULL, _IONBF, BUFSIZ);
                setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ);
@@ -337,12 +336,6 @@ Py_Main(int argc, char **argv)
                setbuf(stdout, (char *)NULL);
                setbuf(stderr, (char *)NULL);
 #endif /* !HAVE_SETVBUF */
-#else /* MPW */
-               /* On MPW (3.2) unbuffered seems to hang */
-               setvbuf(stdin,  (char *)NULL, _IOLBF, BUFSIZ);
-               setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ);
-               setvbuf(stderr, (char *)NULL, _IOLBF, BUFSIZ);
-#endif /* MPW */
        }
        else if (Py_InteractiveFlag) {
 #ifdef MS_WINDOWS
index 54152538aad7e82599b595ff6eac733d2ba53610..48c981a5ab09079cf850f89883a999e02f43c3a5 100644 (file)
@@ -121,13 +121,8 @@ FUNC2(fmod, fmod,
       "  x % y may differ.")
 FUNC2(hypot, hypot,
       "hypot(x,y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y).")
-#ifdef MPW_3_1 /* This hack is needed for MPW 3.1 but not for 3.2 ... */
-FUNC2(pow, power,
-      "pow(x,y)\n\nReturn x**y (x to the power of y).")
-#else
 FUNC2(pow, pow,
       "pow(x,y)\n\nReturn x**y (x to the power of y).")
-#endif
 FUNC1(sin, sin,
       "sin(x)\n\nReturn the sine of x (measured in radians).")
 FUNC1(sinh, sinh,
@@ -190,15 +185,7 @@ math_modf(PyObject *self, PyObject *args)
        if (! PyArg_ParseTuple(args, "d:modf", &x))
                return NULL;
        errno = 0;
-#ifdef MPW /* MPW C modf expects pointer to extended as second argument */
-        {
-               extended e;
-               x = modf(x, &e);
-               y = e;
-        }
-#else
        x = modf(x, &y);
-#endif
        Py_SET_ERANGE_IF_OVERFLOW(x);
        if (errno && is_error(x))
                return NULL;
index d85f697fa4e4c3ccead499d84e775db6c39f0a14..33e146ae9fb95b18b47d39a6f4e5933e9445d529 100644 (file)
@@ -908,15 +908,7 @@ _Py_HashDouble(double v)
         * of mapping keys will turn out weird.
         */
 
-#ifdef MPW /* MPW C modf expects pointer to extended as second argument */
-{
-       extended e;
-       fractpart = modf(v, &e);
-       intpart = e;
-}
-#else
        fractpart = modf(v, &intpart);
-#endif
        if (fractpart == 0.0) {
                /* This must return the same hash as an equal int or long. */
                if (intpart > LONG_MAX || -intpart > LONG_MAX) {
index 63919c5efca8af2fdfb669969bea36f0f9907b97..5f470fa086ab8cc0f82db7b3fdcd9548ab21f7e0 100644 (file)
@@ -89,27 +89,10 @@ fixstate(grammar *g, state *s)
                        }
                        for (ibit = 0; ibit < g->g_ll.ll_nlabels; ibit++) {
                                if (testbit(d1->d_first, ibit)) {
-#ifdef applec
-#define MPW_881_BUG                    /* Undefine if bug below is fixed */
-#endif
-#ifdef MPW_881_BUG
-                                       /* In 881 mode MPW 3.1 has a code
-                                          generation bug which seems to
-                                          set the upper bits; fix this by
-                                          explicitly masking them off */
-                                       int temp;
-#endif
                                        if (accel[ibit] != -1)
                                                printf("XXX ambiguity!\n");
-#ifdef MPW_881_BUG
-                                       temp = 0xFFFF &
-                                               (a->a_arrow | (1 << 7) |
-                                                ((type - NT_OFFSET) << 8));
-                                       accel[ibit] = temp;
-#else
                                        accel[ibit] = a->a_arrow | (1 << 7) |
                                                ((type - NT_OFFSET) << 8);
-#endif
                                }
                        }
                }
index fcc4667d7f64ffcb495b3d98e9d66fa8573b4ccc..fd2b4f4c33a981f3b40dc7311d55df740b9072aa 100644 (file)
@@ -123,13 +123,6 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
                *p = '\0';
                break;
        }
-#ifdef MPW
-       /* Hack for MPW C where the prompt comes right back in the input */
-       /* XXX (Actually this would be rather nice on most systems...) */
-       n = strlen(prompt);
-       if (strncmp(p, prompt, n) == 0)
-               memmove(p, p + n, strlen(p) - n + 1);
-#endif
        n = strlen(p);
        while (n > 0 && p[n-1] != '\n') {
                size_t incr = n+2;
index ec85511ebdf87326267aae81dad549e32bf7a62b..f26d7b8eca2a181852cb67c6c3495353b9dd8eb9 100644 (file)
@@ -3,11 +3,7 @@
 
 #include "Python.h"
 
-#ifdef MPW /* MPW pushes 'extended' for float and double types with varargs */
-typedef extended va_double;
-#else
 typedef double va_double;
-#endif
 
 /* Package context -- the full module name for package imports */
 char *_Py_PackageContext = NULL;
index db98d2b31a50db71a60ede594bfa78e1b11d8166..8e60c0c0726106ad194f3e7f0e369aafa3fa68e4 100644 (file)
@@ -100,7 +100,6 @@ PyOS_strtoul(register char *str, char **ptr, int base)
        }
        temp = result;
        result = result * base + c;
-#ifndef MPW
        if(base == 10) {
                if(((long)(result - c) / base != (long)temp))   /* overflow */
                        ovf = 1;
@@ -109,7 +108,6 @@ PyOS_strtoul(register char *str, char **ptr, int base)
                if ((result - c) / base != temp)        /* overflow */
                        ovf = 1;
        }
-#endif
        str++;
     }
 
index ab6ed58e524654dba45177099ba4dd06c589bb9b..c09a3ff901522d4360d45c50ccc91495f2457d6c 100644 (file)
@@ -1566,18 +1566,6 @@ initsigs(void)
        PyOS_InitInterrupts(); /* May imply initsignal() */
 }
 
-#ifdef MPW
-
-/* Check for file descriptor connected to interactive device.
-   Pretend that stdin is always interactive, other files never. */
-
-int
-isatty(int fd)
-{
-       return fd == fileno(stdin);
-}
-
-#endif
 
 /*
  * The file descriptor fd is considered ``interactive'' if either
index b8edf139644da6db8fc845202fb598815f1b743d..987013ccf5a3e068e9bef062f803dda923117a1f 100644 (file)
@@ -147,13 +147,8 @@ tb_displayline(PyObject *f, char *filename, int lineno, char *name)
        int i;
        if (filename == NULL || name == NULL)
                return -1;
-#ifdef MPW
-       /* This is needed by MPW's File and Line commands */
-#define FMT "  File \"%.500s\"; line %d # in %.500s\n"
-#else
        /* This is needed by Emacs' compile command */
 #define FMT "  File \"%.500s\", line %d, in %.500s\n"
-#endif
        xfp = fopen(filename, "r" PY_STDIOTEXTMODE);
        if (xfp == NULL) {
                /* Search tail of filename in sys.path before giving up */