Skip to content

Commit 73a07af

Browse files
author
jackjansen
committed
Getting rid of support for the ancient Apple MPW compiler.
git-svn-id: http://svn.python.org/projects/python/trunk@34686 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 11bc20f commit 73a07af

10 files changed

Lines changed: 0 additions & 80 deletions

File tree

Mac/Modules/macosmodule.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ static PyObject *MacOS_Error; /* Exception MacOS.Error */
4747
#define PATHNAMELEN 256
4848
#endif
4949

50-
#ifdef MPW
51-
#define bufferIsSmall -607 /*error returns from Post and Accept */
52-
#endif
53-
5450
/* ----------------------------------------------------- */
5551

5652
/* Declarations for objects of type Resource fork */
@@ -778,4 +774,3 @@ initMacOS(void)
778774
return;
779775

780776
}
781-

Modules/main.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ Py_Main(int argc, char **argv)
327327
_setmode(fileno(stdin), O_BINARY);
328328
_setmode(fileno(stdout), O_BINARY);
329329
#endif
330-
#ifndef MPW
331330
#ifdef HAVE_SETVBUF
332331
setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ);
333332
setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ);
@@ -337,12 +336,6 @@ Py_Main(int argc, char **argv)
337336
setbuf(stdout, (char *)NULL);
338337
setbuf(stderr, (char *)NULL);
339338
#endif /* !HAVE_SETVBUF */
340-
#else /* MPW */
341-
/* On MPW (3.2) unbuffered seems to hang */
342-
setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ);
343-
setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ);
344-
setvbuf(stderr, (char *)NULL, _IOLBF, BUFSIZ);
345-
#endif /* MPW */
346339
}
347340
else if (Py_InteractiveFlag) {
348341
#ifdef MS_WINDOWS

Modules/mathmodule.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,8 @@ FUNC2(fmod, fmod,
121121
" x % y may differ.")
122122
FUNC2(hypot, hypot,
123123
"hypot(x,y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y).")
124-
#ifdef MPW_3_1 /* This hack is needed for MPW 3.1 but not for 3.2 ... */
125-
FUNC2(pow, power,
126-
"pow(x,y)\n\nReturn x**y (x to the power of y).")
127-
#else
128124
FUNC2(pow, pow,
129125
"pow(x,y)\n\nReturn x**y (x to the power of y).")
130-
#endif
131126
FUNC1(sin, sin,
132127
"sin(x)\n\nReturn the sine of x (measured in radians).")
133128
FUNC1(sinh, sinh,
@@ -190,15 +185,7 @@ math_modf(PyObject *self, PyObject *args)
190185
if (! PyArg_ParseTuple(args, "d:modf", &x))
191186
return NULL;
192187
errno = 0;
193-
#ifdef MPW /* MPW C modf expects pointer to extended as second argument */
194-
{
195-
extended e;
196-
x = modf(x, &e);
197-
y = e;
198-
}
199-
#else
200188
x = modf(x, &y);
201-
#endif
202189
Py_SET_ERANGE_IF_OVERFLOW(x);
203190
if (errno && is_error(x))
204191
return NULL;

Objects/object.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -908,15 +908,7 @@ _Py_HashDouble(double v)
908908
* of mapping keys will turn out weird.
909909
*/
910910

911-
#ifdef MPW /* MPW C modf expects pointer to extended as second argument */
912-
{
913-
extended e;
914-
fractpart = modf(v, &e);
915-
intpart = e;
916-
}
917-
#else
918911
fractpart = modf(v, &intpart);
919-
#endif
920912
if (fractpart == 0.0) {
921913
/* This must return the same hash as an equal int or long. */
922914
if (intpart > LONG_MAX || -intpart > LONG_MAX) {

Parser/acceler.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,10 @@ fixstate(grammar *g, state *s)
8989
}
9090
for (ibit = 0; ibit < g->g_ll.ll_nlabels; ibit++) {
9191
if (testbit(d1->d_first, ibit)) {
92-
#ifdef applec
93-
#define MPW_881_BUG /* Undefine if bug below is fixed */
94-
#endif
95-
#ifdef MPW_881_BUG
96-
/* In 881 mode MPW 3.1 has a code
97-
generation bug which seems to
98-
set the upper bits; fix this by
99-
explicitly masking them off */
100-
int temp;
101-
#endif
10292
if (accel[ibit] != -1)
10393
printf("XXX ambiguity!\n");
104-
#ifdef MPW_881_BUG
105-
temp = 0xFFFF &
106-
(a->a_arrow | (1 << 7) |
107-
((type - NT_OFFSET) << 8));
108-
accel[ibit] = temp;
109-
#else
11094
accel[ibit] = a->a_arrow | (1 << 7) |
11195
((type - NT_OFFSET) << 8);
112-
#endif
11396
}
11497
}
11598
}

Parser/myreadline.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,6 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
123123
*p = '\0';
124124
break;
125125
}
126-
#ifdef MPW
127-
/* Hack for MPW C where the prompt comes right back in the input */
128-
/* XXX (Actually this would be rather nice on most systems...) */
129-
n = strlen(prompt);
130-
if (strncmp(p, prompt, n) == 0)
131-
memmove(p, p + n, strlen(p) - n + 1);
132-
#endif
133126
n = strlen(p);
134127
while (n > 0 && p[n-1] != '\n') {
135128
size_t incr = n+2;

Python/modsupport.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
#include "Python.h"
55

6-
#ifdef MPW /* MPW pushes 'extended' for float and double types with varargs */
7-
typedef extended va_double;
8-
#else
96
typedef double va_double;
10-
#endif
117

128
/* Package context -- the full module name for package imports */
139
char *_Py_PackageContext = NULL;

Python/mystrtoul.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ PyOS_strtoul(register char *str, char **ptr, int base)
100100
}
101101
temp = result;
102102
result = result * base + c;
103-
#ifndef MPW
104103
if(base == 10) {
105104
if(((long)(result - c) / base != (long)temp)) /* overflow */
106105
ovf = 1;
@@ -109,7 +108,6 @@ PyOS_strtoul(register char *str, char **ptr, int base)
109108
if ((result - c) / base != temp) /* overflow */
110109
ovf = 1;
111110
}
112-
#endif
113111
str++;
114112
}
115113

Python/pythonrun.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,18 +1566,6 @@ initsigs(void)
15661566
PyOS_InitInterrupts(); /* May imply initsignal() */
15671567
}
15681568

1569-
#ifdef MPW
1570-
1571-
/* Check for file descriptor connected to interactive device.
1572-
Pretend that stdin is always interactive, other files never. */
1573-
1574-
int
1575-
isatty(int fd)
1576-
{
1577-
return fd == fileno(stdin);
1578-
}
1579-
1580-
#endif
15811569

15821570
/*
15831571
* The file descriptor fd is considered ``interactive'' if either

Python/traceback.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,8 @@ tb_displayline(PyObject *f, char *filename, int lineno, char *name)
147147
int i;
148148
if (filename == NULL || name == NULL)
149149
return -1;
150-
#ifdef MPW
151-
/* This is needed by MPW's File and Line commands */
152-
#define FMT " File \"%.500s\"; line %d # in %.500s\n"
153-
#else
154150
/* This is needed by Emacs' compile command */
155151
#define FMT " File \"%.500s\", line %d, in %.500s\n"
156-
#endif
157152
xfp = fopen(filename, "r" PY_STDIOTEXTMODE);
158153
if (xfp == NULL) {
159154
/* Search tail of filename in sys.path before giving up */

0 commit comments

Comments
 (0)