Got rid of ifdefs for long-obsolete GUSI versions.
This commit is contained in:
parent
9b745f6665
commit
8ab04b4d65
|
@ -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 */
|
||||
|
||||
/*******************************
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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)",
|
||||
|
|
Loading…
Reference in New Issue