Getting rid of support for the ancient Apple MPW compiler.

This commit is contained in:
Jack Jansen 2003-11-19 15:24:47 +00:00
parent 6196322066
commit fb2765666f
10 changed files with 0 additions and 80 deletions

View 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;
}

View 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

View 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;

View 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) {

View 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
}
}
}

View 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;

View 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;

View 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++;
}

View 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

View 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 */