]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Getting rid of code dependent on GUSI or the MetroWerks compiler.
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 19 Nov 2003 22:52:23 +0000 (22:52 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 19 Nov 2003 22:52:23 +0000 (22:52 +0000)
Modules/_localemodule.c
Modules/errnomodule.c
Modules/socketmodule.c
Modules/structmodule.c
Objects/fileobject.c
Python/thread.c
Python/thread_pthread.h

index 5862c1e59b192d42bf870f9527b0a02295408cca..9f185be9abbd1a7c0c1d260b45f8085139d607e1 100644 (file)
@@ -34,7 +34,7 @@ This software comes with no warranty. Use at your own risk.
 #include <windows.h>
 #endif
 
-#if defined(__APPLE__) || defined(__MWERKS__)
+#if defined(__APPLE__)
 #include "macglue.h"
 #endif
 
index cd3d2fab9b6609f44f4ee28602da3765059690f2..e9c0990c28e06d388c3250aace90ff4de08bb291 100644 (file)
@@ -3,11 +3,6 @@
 
 #include "Python.h"
 
-/* Mac with GUSI has more errors than those in errno.h */
-#ifdef USE_GUSI
-#include <sys/errno.h>
-#endif
-
 /* Windows socket errors (WSA*)  */
 #ifdef MS_WINDOWS
 #include <winsock.h>
index 427fb29d22125447b02b2b6d005270304b5a75f7..f93da4ec0767597c97635ded6d833dc2e42693e3 100644 (file)
@@ -1739,11 +1739,6 @@ sock_makefile(PySocketSockObject *s, PyObject *args)
                        SOCKETCLOSE(fd);
                return s->errorhandler();
        }
-#ifdef USE_GUSI2
-       /* Workaround for bug in Metrowerks MSL vs. GUSI I/O library */
-       if (strchr(mode, 'b') != NULL)
-               bufsize = 0;
-#endif
        f = PyFile_FromFile(fp, "<socket>", mode, fclose);
        if (f != NULL)
                PyFile_SetBufSize(f, bufsize);
index 22f1c549772633eb6d4954cbd86fc73e37616e2f..b78231f4d3cfcb85d3e3bcd19f03160ad8d775d6 100644 (file)
@@ -41,15 +41,6 @@ static PyObject *StructError;
 
 /* Define various structs to figure out the alignments of types */
 
-#ifdef __MWERKS__
-/*
-** XXXX We have a problem here. There are no unique alignment rules
-** on the PowerPC mac.
-*/
-#ifdef __powerc
-#pragma options align=mac68k
-#endif
-#endif /* __MWERKS__ */
 
 typedef struct { char c; short x; } st_short;
 typedef struct { char c; int x; } st_int;
index ff66117b111d9c47581ef2757fa51b2f8d922c1f..66e5f2865f6d314eae8d904e56e4125add2fe989 100644 (file)
 #include <windows.h>
 #endif /* _MSC_VER */
 
-#ifdef macintosh
-#ifdef USE_GUSI
-#define HAVE_FTRUNCATE
-#endif
-#endif
-
-#ifdef __MWERKS__
-/* Mwerks fopen() doesn't always set errno */
-#define NO_FOPEN_ERRNO
-#endif
-
 #if defined(PYOS_OS2) && defined(PYCC_GCC)
 #include <io.h>
 #endif
@@ -209,18 +198,6 @@ open_the_file(PyFileObject *f, char *name, char *mode)
                }
        }
        if (f->f_fp == NULL) {
-#ifdef NO_FOPEN_ERRNO
-               /* Metroworks only, wich does not always sets errno */
-               if (errno == 0) {
-                       PyObject *v;
-                       v = Py_BuildValue("(is)", 0, "Cannot open file");
-                       if (v != NULL) {
-                               PyErr_SetObject(PyExc_IOError, v);
-                               Py_DECREF(v);
-                       }
-                       return NULL;
-               }
-#endif
 #ifdef _MSC_VER
                /* MSVC 6 (Microsoft) leaves errno at 0 for bad mode strings,
                 * across all Windows flavors.  When it sets EINVAL varies
@@ -739,12 +716,7 @@ new_buffersize(PyFileObject *f, size_t currentsize)
                   works.  We can't use the lseek() value either, because we
                   need to take the amount of buffered data into account.
                   (Yet another reason why stdio stinks. :-) */
-#ifdef USE_GUSI2
-               pos = lseek(fileno(f->f_fp), 1L, SEEK_CUR);
-               pos = lseek(fileno(f->f_fp), -1L, SEEK_CUR);
-#else
                pos = lseek(fileno(f->f_fp), 0L, SEEK_CUR);
-#endif
                if (pos >= 0) {
                        pos = ftell(f->f_fp);
                }
index 2298b383e79e69c48701bda2fdae7de5ec8e3eb0..ca2d6c664b35f0745d762c8876b0308a04a9e79c 100644 (file)
@@ -45,10 +45,6 @@ extern char *getenv(const char *);
 #define SUN_LWP
 #endif
 
-#if defined(__MWERKS__) && !defined(__BEOS__)
-#define _POSIX_THREADS
-#endif
-
 #endif /* _POSIX_THREADS */
 
 
index 0f7ad20c2ab2d7abf631e9cd944af71bf8e6f2c0..cb03a9ba6e8806d266a1f6c49478299b7aa49157 100644 (file)
 
 #endif
 
-#ifdef USE_GUSI
-/* The Macintosh GUSI I/O library sets the stackspace to
-** 20KB, much too low. We up it to 64K.
-*/
-#define THREAD_STACK_SIZE 0x10000
-#endif
-
-
 /* set default attribute object for different versions */
 
 #if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D7)