Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4bae2d5

Browse files
committed
Getting rid of code dependent on GUSI or the MetroWerks compiler.
1 parent bc2fbc7 commit 4bae2d5

7 files changed

Lines changed: 1 addition & 60 deletions

File tree

Modules/_localemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This software comes with no warranty. Use at your own risk.
3434
#include <windows.h>
3535
#endif
3636

37-
#if defined(__APPLE__) || defined(__MWERKS__)
37+
#if defined(__APPLE__)
3838
#include "macglue.h"
3939
#endif
4040

Modules/errnomodule.c

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

44
#include "Python.h"
55

6-
/* Mac with GUSI has more errors than those in errno.h */
7-
#ifdef USE_GUSI
8-
#include <sys/errno.h>
9-
#endif
10-
116
/* Windows socket errors (WSA*) */
127
#ifdef MS_WINDOWS
138
#include <winsock.h>

Modules/socketmodule.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,11 +1739,6 @@ sock_makefile(PySocketSockObject *s, PyObject *args)
17391739
SOCKETCLOSE(fd);
17401740
return s->errorhandler();
17411741
}
1742-
#ifdef USE_GUSI2
1743-
/* Workaround for bug in Metrowerks MSL vs. GUSI I/O library */
1744-
if (strchr(mode, 'b') != NULL)
1745-
bufsize = 0;
1746-
#endif
17471742
f = PyFile_FromFile(fp, "<socket>", mode, fclose);
17481743
if (f != NULL)
17491744
PyFile_SetBufSize(f, bufsize);

Modules/structmodule.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ static PyObject *StructError;
4141

4242
/* Define various structs to figure out the alignments of types */
4343

44-
#ifdef __MWERKS__
45-
/*
46-
** XXXX We have a problem here. There are no unique alignment rules
47-
** on the PowerPC mac.
48-
*/
49-
#ifdef __powerc
50-
#pragma options align=mac68k
51-
#endif
52-
#endif /* __MWERKS__ */
5344

5445
typedef struct { char c; short x; } st_short;
5546
typedef struct { char c; int x; } st_int;

Objects/fileobject.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,6 @@
2121
#include <windows.h>
2222
#endif /* _MSC_VER */
2323

24-
#ifdef macintosh
25-
#ifdef USE_GUSI
26-
#define HAVE_FTRUNCATE
27-
#endif
28-
#endif
29-
30-
#ifdef __MWERKS__
31-
/* Mwerks fopen() doesn't always set errno */
32-
#define NO_FOPEN_ERRNO
33-
#endif
34-
3524
#if defined(PYOS_OS2) && defined(PYCC_GCC)
3625
#include <io.h>
3726
#endif
@@ -209,18 +198,6 @@ open_the_file(PyFileObject *f, char *name, char *mode)
209198
}
210199
}
211200
if (f->f_fp == NULL) {
212-
#ifdef NO_FOPEN_ERRNO
213-
/* Metroworks only, wich does not always sets errno */
214-
if (errno == 0) {
215-
PyObject *v;
216-
v = Py_BuildValue("(is)", 0, "Cannot open file");
217-
if (v != NULL) {
218-
PyErr_SetObject(PyExc_IOError, v);
219-
Py_DECREF(v);
220-
}
221-
return NULL;
222-
}
223-
#endif
224201
#ifdef _MSC_VER
225202
/* MSVC 6 (Microsoft) leaves errno at 0 for bad mode strings,
226203
* across all Windows flavors. When it sets EINVAL varies
@@ -739,12 +716,7 @@ new_buffersize(PyFileObject *f, size_t currentsize)
739716
works. We can't use the lseek() value either, because we
740717
need to take the amount of buffered data into account.
741718
(Yet another reason why stdio stinks. :-) */
742-
#ifdef USE_GUSI2
743-
pos = lseek(fileno(f->f_fp), 1L, SEEK_CUR);
744-
pos = lseek(fileno(f->f_fp), -1L, SEEK_CUR);
745-
#else
746719
pos = lseek(fileno(f->f_fp), 0L, SEEK_CUR);
747-
#endif
748720
if (pos >= 0) {
749721
pos = ftell(f->f_fp);
750722
}

Python/thread.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ extern char *getenv(const char *);
4545
#define SUN_LWP
4646
#endif
4747

48-
#if defined(__MWERKS__) && !defined(__BEOS__)
49-
#define _POSIX_THREADS
50-
#endif
51-
5248
#endif /* _POSIX_THREADS */
5349

5450

Python/thread_pthread.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@
6868

6969
#endif
7070

71-
#ifdef USE_GUSI
72-
/* The Macintosh GUSI I/O library sets the stackspace to
73-
** 20KB, much too low. We up it to 64K.
74-
*/
75-
#define THREAD_STACK_SIZE 0x10000
76-
#endif
77-
78-
7971
/* set default attribute object for different versions */
8072

8173
#if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D7)

0 commit comments

Comments
 (0)