]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Got rid of ifdefs for long-obsolete GUSI versions.
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 11 Apr 2002 20:46:23 +0000 (20:46 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 11 Apr 2002 20:46:23 +0000 (20:46 +0000)
Include/pyport.h
Mac/Include/pyconfig.h
Mac/Modules/macmodule.c
Mac/Python/macgetcompiler.c
Modules/socketmodule.c
Modules/timemodule.c
Python/import.c

index b311bd89b445e28076a45d1a437b8b6f97b4e2da..86bbab2b89029997089c5546fe8883440bc0c4dc 100644 (file)
@@ -117,13 +117,6 @@ typedef LONG_LONG          Py_intptr_t;
 
 #include <sys/select.h>
 
-#else /* !HAVE_SYS_SELECT_H */
-
-#ifdef USE_GUSI1
-/* If we don't have sys/select the definition may be in unistd.h */
-#include <GUSI.h>
-#endif
-
 #endif /* !HAVE_SYS_SELECT_H */
 
 /*******************************
index ac4e15a96127688be04d4a8ce9fad5c2d04ad01f..15bef5a1fc3bada61cff557fed3bfb9f6057370c 100644 (file)
@@ -36,7 +36,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define macintosh
 #endif
 
-#if defined(USE_GUSI1) || defined(USE_GUSI2)
+#if defined(USE_GUSI2)
 #define USE_GUSI
 #endif
 
index 93dfaee1bf87566a97b8ce35d9d600d4471a9b24..8b3bcc53148eaf4d5c5bdee1bfe76a5847c0b71b 100644 (file)
@@ -46,9 +46,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #undef S_IWRITE
 #undef S_IEXEC
 
-#ifdef USE_GUSI1
-#include <GUSI.h>
-#endif /* USE_GUSI1 */
 #include <sys/types.h>
 #include <sys/stat.h>
 #else /* USE_GUSI */
@@ -181,17 +178,7 @@ mac_chdir(self, args)
        PyObject *self;
        PyObject *args;
 {
-#ifdef USE_GUSI1
-       PyObject *rv;
-       
-       /* Change MacOS's idea of wd too */
-       rv = mac_1str(args, chdir);
-       PyMac_FixGUSIcd();
-       return rv;
-#else
        return mac_1str(args, chdir);
-#endif
-
 }
 
 static PyObject *
@@ -205,11 +192,8 @@ mac_close(self, args)
        Py_BEGIN_ALLOW_THREADS
        res = close(fd);
        Py_END_ALLOW_THREADS
-#ifndef USE_GUSI1
-       /* GUSI gives surious errors here? */
        if (res < 0)
                return mac_error();
-#endif
        Py_INCREF(Py_None);
        return Py_None;
 }
@@ -385,11 +369,7 @@ mac_mkdir(self, args)
        if (!PyArg_ParseTuple(args, "s|i", &path, &mode))
                return NULL;
        Py_BEGIN_ALLOW_THREADS
-#ifdef USE_GUSI1
-       res = mkdir(path);
-#else
        res = mkdir(path, mode);
-#endif
        Py_END_ALLOW_THREADS
        if (res < 0)
                return mac_error();
index eb9c3c45fbdbce6062f4e03ef76133f601752c7a..46c0bf3b57a93fa3c7e7521ba9880e5a3523fcaa 100644 (file)
@@ -35,15 +35,11 @@ PERFORMANCE OF THIS SOFTWARE.
 #include "Python.h"
 
 #ifdef __MWERKS__
-#ifdef USE_GUSI1
-#define HASGUSI " GUSI1"
-#else
 #ifdef USE_GUSI2
 #define HASGUSI " GUSI2"
 #else
 #define HASGUSI ""
 #endif
-#endif
 
 #ifdef WITH_THREAD
 #define HASTHREAD " THREADS"
index 74e28f2681a142c6c0b333e6b75641f00bfe9d6e..4366b17776df429773962319ee3187c99442c8cb 100644 (file)
@@ -149,9 +149,7 @@ Socket methods:
 #  include <netdb.h>
 typedef size_t socklen_t;
 # else
-#  ifndef USE_GUSI1
 #   include <arpa/inet.h>
-#  endif
 # endif
 
 # ifndef RISCOS
@@ -181,11 +179,6 @@ int h_errno; /* not used */
 # define O_NDELAY O_NONBLOCK   /* For QNX only? */
 #endif
 
-#ifdef USE_GUSI1
-/* fdopen() isn't declared in stdio.h (sigh) */
-# include <GUSI.h>
-#endif
-
 #include "addrinfo.h"
 
 #ifndef HAVE_INET_PTON
@@ -2332,11 +2325,7 @@ PySocket_inet_aton(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s:inet_aton", &ip_addr)) {
                return NULL;
        }
-#ifdef USE_GUSI1
-       packed_addr = inet_addr(ip_addr).s_addr;
-#else
        packed_addr = inet_addr(ip_addr);
-#endif
 
        if (packed_addr == INADDR_NONE) {       /* invalid address */
                PyErr_SetString(PySocket_Error,
@@ -3331,11 +3320,7 @@ inet_pton (int af, const char *src, void *dst)
 {
        if(af == AF_INET){
                long packed_addr;
-#ifdef USE_GUSI1
-               packed_addr = (long)inet_addr(src).s_addr;
-#else
                packed_addr = inet_addr(src);
-#endif
                if (packed_addr == INADDR_NONE)
                        return 0;
                memcpy(dst, &packed_addr, 4);
index 939682643074d8522bf5716c8c945f9ed7258ffa..dda2ce4ee57a8e2b82189908a5b611aecdddff9e 100644 (file)
@@ -9,13 +9,6 @@
 #ifdef macintosh
 #include <time.h>
 #include <OSUtils.h>
-#ifdef USE_GUSI211
-/* GUSI, the I/O library which has the time() function and such uses the
-** Mac epoch of 1904. MSL, the C library which has localtime() and so uses
-** the ANSI epoch of 1900.
-*/
-#define GUSI_TO_MSL_EPOCH (4*365*24*60*60)
-#endif /* USE_GUSI2 */
 #else
 #include <sys/types.h>
 #endif
@@ -259,9 +252,6 @@ time_convert(time_t when, struct tm * (*function)(const time_t *))
 {
        struct tm *p;
        errno = 0;
-#if defined(macintosh) && defined(USE_GUSI204)
-       when = when + GUSI_TO_MSL_EPOCH;
-#endif
        p = function(&when);
        if (p == NULL) {
 #ifdef EINVAL
@@ -487,9 +477,6 @@ time_ctime(PyObject *self, PyObject *args)
                        return NULL;
                tt = (time_t)dt;
        }
-#if defined(macintosh) && defined(USE_GUSI204)
-       tt = tt + GUSI_TO_MSL_EPOCH;
-#endif
        p = ctime(&tt);
        if (p == NULL) {
                PyErr_SetString(PyExc_ValueError, "unconvertible time");
@@ -526,9 +513,6 @@ time_mktime(PyObject *self, PyObject *args)
                                "mktime argument out of range");
                return NULL;
        }
-#if defined(macintosh) && defined(USE_GUSI211)
-       tt = tt - GUSI_TO_MSL_EPOCH;
-#endif
        return PyFloat_FromDouble((double)tt);
 }
 
index 1a061532d032ddb921da750e5534900f50435a2d..3c8750671e5d7741b6527a63584b223ea247d564 100644 (file)
@@ -1139,9 +1139,6 @@ find_module(char *realname, PyObject *path, char *buf, size_t buflen,
 
 #elif defined(macintosh)
 #include <TextUtils.h>
-#ifdef USE_GUSI1
-#include "TFileSpec.h"         /* for Path2FSSpec() */
-#endif
 
 #elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H)
 #include <sys/types.h>
@@ -1215,25 +1212,7 @@ case_ok(char *buf, int len, int namelen, char *name)
        if (Py_GETENV("PYTHONCASEOK") != NULL)
                return 1;
 
-#ifndef USE_GUSI1
        err = FSMakeFSSpec(0, 0, Pstring(buf), &fss);
-#else
-       /* GUSI's Path2FSSpec() resolves all possible aliases nicely on
-          the way, which is fine for all directories, but here we need
-          the original name of the alias file (say, Dlg.ppc.slb, not
-          toolboxmodules.ppc.slb). */
-       char *colon;
-       err = Path2FSSpec(buf, &fss);
-       if (err == noErr) {
-               colon = strrchr(buf, ':'); /* find filename */
-               if (colon != NULL)
-                       err = FSMakeFSSpec(fss.vRefNum, fss.parID,
-                                          Pstring(colon+1), &fss);
-               else
-                       err = FSMakeFSSpec(fss.vRefNum, fss.parID,
-                                          fss.name, &fss);
-       }
-#endif
        if (err) {
                PyErr_Format(PyExc_NameError,
                     "Can't find file for module %.100s\n(filename %.300s)",