From 8ab04b4d65586829887822a78d038a33ee7a69fd Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 11 Apr 2002 20:46:23 +0000 Subject: Got rid of ifdefs for long-obsolete GUSI versions. --- Include/pyport.h | 7 ------- Mac/Include/pyconfig.h | 2 +- Mac/Modules/macmodule.c | 20 -------------------- Mac/Python/macgetcompiler.c | 4 ---- Modules/socketmodule.c | 15 --------------- Modules/timemodule.c | 16 ---------------- Python/import.c | 21 --------------------- 7 files changed, 1 insertion(+), 84 deletions(-) diff --git a/Include/pyport.h b/Include/pyport.h index b311bd8..86bbab2 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -117,13 +117,6 @@ typedef LONG_LONG Py_intptr_t; #include -#else /* !HAVE_SYS_SELECT_H */ - -#ifdef USE_GUSI1 -/* If we don't have sys/select the definition may be in unistd.h */ -#include -#endif - #endif /* !HAVE_SYS_SELECT_H */ /******************************* diff --git a/Mac/Include/pyconfig.h b/Mac/Include/pyconfig.h index ac4e15a..15bef5a 100644 --- a/Mac/Include/pyconfig.h +++ b/Mac/Include/pyconfig.h @@ -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 diff --git a/Mac/Modules/macmodule.c b/Mac/Modules/macmodule.c index 93dfaee..8b3bcc5 100644 --- a/Mac/Modules/macmodule.c +++ b/Mac/Modules/macmodule.c @@ -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 -#endif /* USE_GUSI1 */ #include #include #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(); diff --git a/Mac/Python/macgetcompiler.c b/Mac/Python/macgetcompiler.c index eb9c3c4..46c0bf3 100644 --- a/Mac/Python/macgetcompiler.c +++ b/Mac/Python/macgetcompiler.c @@ -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" diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 74e28f2..4366b17 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -149,9 +149,7 @@ Socket methods: # include typedef size_t socklen_t; # else -# ifndef USE_GUSI1 # include -# 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 -#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); diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 9396826..dda2ce4 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -9,13 +9,6 @@ #ifdef macintosh #include #include -#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 #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); } diff --git a/Python/import.c b/Python/import.c index 1a06153..3c87506 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1139,9 +1139,6 @@ find_module(char *realname, PyObject *path, char *buf, size_t buflen, #elif defined(macintosh) #include -#ifdef USE_GUSI1 -#include "TFileSpec.h" /* for Path2FSSpec() */ -#endif #elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H) #include @@ -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)", -- cgit v0.12