From eddc1449bae39414aaf7a4f63ccd3b69c4fb069e Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 20 Nov 2003 01:44:59 +0000 Subject: Getting rid of all the code inside #ifdef macintosh too. --- Include/osdefs.h | 7 --- Include/structmember.h | 4 -- Mac/Include/macglue.h | 48 ---------------- Modules/_hotshot.c | 8 +-- Modules/_tkinter.c | 151 +------------------------------------------------ Modules/getbuildinfo.c | 4 -- Modules/parsermodule.c | 4 -- Modules/timemodule.c | 56 ------------------ Objects/floatobject.c | 2 +- Objects/object.c | 4 -- Parser/intrcheck.c | 8 --- Parser/pgenmain.c | 9 --- Parser/tokenizer.c | 11 ---- Python/ceval.c | 6 +- Python/errors.c | 6 -- Python/import.c | 94 ------------------------------ Python/pythonrun.c | 14 ----- Python/strerror.c | 5 -- Python/structmember.c | 23 +------- 19 files changed, 6 insertions(+), 458 deletions(-) diff --git a/Include/osdefs.h b/Include/osdefs.h index 89e0ecb..8190a75 100644 --- a/Include/osdefs.h +++ b/Include/osdefs.h @@ -7,13 +7,6 @@ extern "C" { /* Operating system dependencies */ -#ifdef macintosh -#define SEP ':' -#define MAXPATHLEN 256 -/* Mod by Jack: newline is less likely to occur in filenames than space */ -#define DELIM '\n' -#endif - /* Mod by chrish: QNX has WATCOM, but isn't DOS */ #if !defined(__QNX__) #if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__) || defined(PYOS_OS2) diff --git a/Include/structmember.h b/Include/structmember.h index 69bdc1b..3f4cfe0 100644 --- a/Include/structmember.h +++ b/Include/structmember.h @@ -63,10 +63,6 @@ typedef struct PyMemberDef { /* Added by Jack: strings contained in the structure */ #define T_STRING_INPLACE 13 -#ifdef macintosh -#define T_PSTRING 14 /* macintosh pascal-style counted string */ -#define T_PSTRING_INPLACE 15 -#endif /* macintosh */ #define T_OBJECT_EX 16 /* Like T_OBJECT, but raises AttributeError when the value is NULL, instead of diff --git a/Mac/Include/macglue.h b/Mac/Include/macglue.h index 799da10..7fd5154 100644 --- a/Mac/Include/macglue.h +++ b/Mac/Include/macglue.h @@ -31,56 +31,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. extern "C" { #endif -/* Scheduler parameters */ -typedef struct { - int check_interrupt; /* if true check for command-dot */ - int process_events; /* if nonzero enable evt processing, this mask */ - int besocial; /* Be social, give up CPU now and again */ - double check_interval; /* how often to check */ - double bg_yield; /* yield at most so long when in background */ -} PyMacSchedParams; - -unsigned char *Pstring(char *str); /* Convert c-string to pascal-string in static buffer */ - -extern short PyMac_AppRefNum; /* RefNum of application rsrcfork (from macmain.c) */ -extern FSSpec PyMac_ApplicationFSSpec; /* Application location (from macargv.c) */ -extern char PyMac_ApplicationPath[]; /* Application location (from macargv.c) */ -extern OSErr PyMac_init_application_location(void); /* Init the above */ -extern int PyMac_GetArgv(char ***, int); /* Get argc, argv (from macargv.c) */ - extern PyObject *PyMac_OSErrException; /* Exception for OSErr */ PyObject *PyMac_GetOSErrException(void); /* Initialize & return it */ - -int PyMac_HandleEvent(EventRecord *); /* Handle one event, possibly in Python */ -void PyMac_HandleEventIntern(EventRecord *); /* Handle one event internal only */ -int PyMac_SetEventHandler(PyObject *); /* set python-coded event handler */ - -int PyMac_FindResourceModule(PyStringObject *, char *, char *); /* Test for 'PYC ' resource in a file */ -PyObject * PyMac_LoadResourceModule(char *, char *); /* Load 'PYC ' resource from file */ -int PyMac_FindCodeResourceModule(PyStringObject *, char *, char *); /* Test for 'PYD ' resource in a file */ -PyObject * PyMac_LoadCodeResourceModule(char *, char *); /* Load 'PYD ' resource from file */ -struct filedescr *PyMac_FindModuleExtension(char *, size_t *, char *); /* Look for module in single folder */ - -void PyMac_InitApplet(void); /* Initialize and run an Applet */ -void PyMac_Initialize(void); /* Initialize function for embedding Python */ - - -/* From macfiletype.c: */ - -long PyMac_getfiletype(char *); /* Get file type */ -int PyMac_setfiletype(char *, long, long); /* Set file creator and type */ - -/* from macmain.c: */ -void PyMac_Exit(int); -void PyMac_InitApplication(void); -void PyMac_OutputSeen(void); -void PyMac_OutputNotSeen(void); -int PyMac_GetDelayConsoleFlag(void); - -/* from macgetargv: */ -OSErr PyMac_init_process_location(void); -char * strdup(const char *str); - #ifdef __cplusplus } #endif diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c index da68970..a04494f 100644 --- a/Modules/_hotshot.c +++ b/Modules/_hotshot.c @@ -26,7 +26,7 @@ typedef __int64 hs_time; #ifndef HAVE_GETTIMEOFDAY #error "This module requires gettimeofday() on non-Windows platforms!" #endif -#if defined(macintosh) || (defined(PYOS_OS2) && defined(PYCC_GCC)) +#if (defined(PYOS_OS2) && defined(PYCC_GCC)) #include #else #include @@ -47,10 +47,6 @@ typedef struct timeval hs_time; #define BUFFERSIZE 10240 -#ifdef macintosh -#define PATH_MAX 254 -#endif - #if defined(PYOS_OS2) && defined(PYCC_GCC) #define PATH_MAX 260 #endif @@ -940,7 +936,7 @@ calibrate(void) } #endif } -#if defined(MS_WINDOWS) || defined(macintosh) || defined(PYOS_OS2) || \ +#if defined(MS_WINDOWS) || defined(PYOS_OS2) || \ defined(__VMS) rusage_diff = -1; #else diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 02e4feb..e6f8953 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -33,10 +33,6 @@ Copyright (C) 1994 Steen Lumholt. #include #endif -#ifdef macintosh -#define MAC_TCL -#endif - /* Allow using this code in Python 2.[12] */ #ifndef PyDoc_STRVAR #define PyDoc_STRVAR(name,str) static char name[] = str @@ -96,15 +92,7 @@ Copyright (C) 1994 Steen Lumholt. #error "unsupported Tcl configuration" #endif -#if defined(macintosh) -/* Sigh, we have to include this to get at the tcl qd pointer */ -#include -/* And this one we need to clear the menu bar */ -#include -#endif - -#if !(defined(MS_WINDOWS) || defined(__CYGWIN__) || defined(macintosh)) -/* Mac has it, but it doesn't really work:-( */ +#if !(defined(MS_WINDOWS) || defined(__CYGWIN__)) #define HAVE_CREATEFILEHANDLER #endif @@ -238,29 +226,6 @@ static PyThreadState *tcl_tstate = NULL; #endif -#ifdef macintosh - -/* -** Additional cruft needed by Tcl/Tk on the Mac. -** This is for Tcl 7.5 and Tk 4.1 (patch release 1). -*/ - -/* ckfree() expects a char* */ -#define FREECAST (char *) - -#include /* For EventRecord */ - -typedef int (*TclMacConvertEventPtr) (EventRecord *eventPtr); -void Tcl_MacSetEventProc(TclMacConvertEventPtr procPtr); -int TkMacConvertEvent(EventRecord *eventPtr); - -static int PyMacConvertEvent(EventRecord *eventPtr); - -#include -extern int SIOUXIsAppWindow(WindowPtr); - -#endif /* macintosh */ - #ifndef FREECAST #define FREECAST (char *) #endif @@ -646,12 +611,6 @@ Tkapp_New(char *screenName, char *baseName, char *className, v->ProcBodyType = Tcl_GetObjType("procbody"); v->StringType = Tcl_GetObjType("string"); -#if defined(macintosh) - /* This seems to be needed */ - ClearMenuBar(); - TkMacInitMenus(v->interp); -#endif - /* Delete the 'exit' command, which can screw things up */ Tcl_DeleteCommand(v->interp, "exit"); @@ -3092,112 +3051,4 @@ init_tkinter(void) Py_AtExit(Tcl_Finalize); #endif -#ifdef macintosh - /* - ** Part of this code is stolen from MacintoshInit in tkMacAppInit. - ** Most of the initializations in that routine (toolbox init calls and - ** such) have already been done for us, so we only need these. - */ - tcl_macQdPtr = &qd; - - Tcl_MacSetEventProc(PyMacConvertEvent); -#if GENERATINGCFM - mac_addlibresources(); -#endif /* GENERATINGCFM */ -#endif /* macintosh */ } - - - -#ifdef macintosh - -/* -** Anyone who embeds Tcl/Tk on the Mac must define panic(). -*/ - -void -panic(char * format, ...) -{ - va_list varg; - - va_start(varg, format); - - vfprintf(stderr, format, varg); - (void) fflush(stderr); - - va_end(varg); - - Py_FatalError("Tcl/Tk panic"); -} - -/* -** Pass events to SIOUX before passing them to Tk. -*/ - -static int -PyMacConvertEvent(EventRecord *eventPtr) -{ - WindowPtr frontwin; - /* - ** Sioux eats too many events, so we don't pass it everything. We - ** always pass update events to Sioux, and we only pass other events if - ** the Sioux window is frontmost. This means that Tk menus don't work - ** in that case, but at least we can scroll the sioux window. - ** Note that the SIOUXIsAppWindow() routine we use here is not really - ** part of the external interface of Sioux... - */ - frontwin = FrontWindow(); - if ( eventPtr->what == updateEvt || SIOUXIsAppWindow(frontwin) ) { - if (SIOUXHandleOneEvent(eventPtr)) - return 0; /* Nothing happened to the Tcl event queue */ - } - return TkMacConvertEvent(eventPtr); -} - -#if GENERATINGCFM - -/* -** Additional Mac specific code for dealing with shared libraries. -*/ - -#include -#include - -static int loaded_from_shlib = 0; -static FSSpec library_fss; - -/* -** If this module is dynamically loaded the following routine should -** be the init routine. It takes care of adding the shared library to -** the resource-file chain, so that the tk routines can find their -** resources. -*/ -OSErr pascal -init_tkinter_shlib(CFragInitBlockPtr data) -{ - __initialize(); - if ( data == nil ) return noErr; - if ( data->fragLocator.where == kDataForkCFragLocator ) { - library_fss = *data->fragLocator.u.onDisk.fileSpec; - loaded_from_shlib = 1; - } else if ( data->fragLocator.where == kResourceCFragLocator ) { - library_fss = *data->fragLocator.u.inSegs.fileSpec; - loaded_from_shlib = 1; - } - return noErr; -} - -/* -** Insert the library resources into the search path. Put them after -** the resources from the application. Again, we ignore errors. -*/ -static -mac_addlibresources(void) -{ - if ( !loaded_from_shlib ) - return; - (void)FSpOpenResFile(&library_fss, fsRdPerm); -} - -#endif /* GENERATINGCFM */ -#endif /* macintosh */ diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index ef444bf..b541bb6 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -1,9 +1,5 @@ #include "Python.h" -#ifdef macintosh -#include "macbuildno.h" -#endif - #ifndef DONT_HAVE_STDIO_H #include #endif diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index 4a795ed..bf6a360 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -39,10 +39,6 @@ #define NOTE(x) #endif -#ifdef macintosh -char *strdup(char *); -#endif - /* String constants used to initialize module attributes. * */ diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 0f7b143..d60f320 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -6,12 +6,7 @@ #include -#ifdef macintosh -#include -#include -#else #include -#endif #ifdef QUICKWIN #include @@ -89,37 +84,6 @@ static double floattime(void); /* For Y2K check */ static PyObject *moddict; -#ifdef macintosh -/* Our own timezone. We have enough information to deduce whether -** DST is on currently, but unfortunately we cannot put it to good -** use because we don't know the rules (and that is needed to have -** localtime() return correct tm_isdst values for times other than -** the current time. So, we cop out and only tell the user the current -** timezone. -*/ -static long timezone; - -static void -initmactimezone(void) -{ - MachineLocation loc; - long delta; - - ReadLocation(&loc); - - if (loc.latitude == 0 && loc.longitude == 0 && loc.u.gmtDelta == 0) - return; - - delta = loc.u.gmtDelta & 0x00FFFFFF; - - if (delta & 0x00800000) - delta |= 0xFF000000; - - timezone = -delta; -} -#endif /* macintosh */ - - static PyObject * time_time(PyObject *self, PyObject *args) { @@ -636,17 +600,6 @@ void inittimezone(PyObject *m) { } } #else -#ifdef macintosh - /* The only thing we can obtain is the current timezone - ** (and whether dst is currently _active_, but that is not what - ** we're looking for:-( ) - */ - initmactimezone(); - PyModule_AddIntConstant(m, "timezone", timezone); - PyModule_AddIntConstant(m, "altzone", timezone); - PyModule_AddIntConstant(m, "daylight", 0); - PyModule_AddObject(m, "tzname", Py_BuildValue("(zz)", "", "")); -#endif /* macintosh */ #endif /* HAVE_STRUCT_TM_TM_ZONE */ #ifdef __CYGWIN__ tzset(); @@ -829,15 +782,6 @@ floatsleep(double secs) } } Py_END_ALLOW_THREADS -#elif defined(macintosh) -#define MacTicks (* (long *)0x16A) - long deadline; - deadline = MacTicks + (long)(secs * 60.0); - while (MacTicks < deadline) { - /* XXX Should call some yielding function here */ - if (PyErr_CheckSignals()) - return -1; - } #elif defined(__WATCOMC__) && !defined(__QNX__) /* XXX Can't interrupt this sleep */ Py_BEGIN_ALLOW_THREADS diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 9ed53e2..66461a8 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -8,7 +8,7 @@ #include -#if !defined(__STDC__) && !defined(macintosh) +#if !defined(__STDC__) extern double fmod(double, double); extern double pow(double, double); #endif diff --git a/Objects/object.c b/Objects/object.c index 33e146a..5b61d84 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -3,10 +3,6 @@ #include "Python.h" -#ifdef macintosh -#include "macglue.h" -#endif - #ifdef Py_REF_DEBUG long _Py_RefTotal; #endif diff --git a/Parser/intrcheck.c b/Parser/intrcheck.c index e2ca5b4..f7434af 100644 --- a/Parser/intrcheck.c +++ b/Parser/intrcheck.c @@ -92,14 +92,6 @@ PyOS_InterruptOccurred(void) #endif /* MSDOS && !QUICKWIN */ -#ifdef macintosh - -/* The Mac interrupt code has moved to macglue.c */ -#define OK - -#endif /* macintosh */ - - #ifndef OK /* Default version -- for real operating systems and for Standard C */ diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c index 7e86ea6..0f68940 100644 --- a/Parser/pgenmain.c +++ b/Parser/pgenmain.c @@ -153,15 +153,6 @@ Py_FatalError(const char *msg) Py_Exit(1); } -#ifdef macintosh -/* ARGSUSED */ -int -guesstabsize(char *path) -{ - return 4; -} -#endif - /* No-nonsense my_readline() for tokenizer.c */ char * diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index a97720c..0821bda 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -784,7 +784,6 @@ tok_nextc(register struct tok_state *tok) done = tok->inp[-1] == '\n'; } tok->cur = tok->buf + cur; -#ifndef macintosh /* replace "\r\n" with "\n" */ /* For Mac we leave the \r, giving a syntax error */ pt = tok->inp - 2; @@ -793,7 +792,6 @@ tok_nextc(register struct tok_state *tok) *pt = '\0'; tok->inp = pt; } -#endif } if (tok->done != E_OK) { if (tok->prompt != NULL) @@ -1185,15 +1183,6 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end) return NEWLINE; } -#ifdef macintosh - if (c == '\r') { - PySys_WriteStderr( - "File contains \\r characters (incorrect line endings?)\n"); - tok->done = E_TOKEN; - tok->cur = tok->inp; - return ERRORTOKEN; - } -#endif /* Period or number starting with period? */ if (c == '.') { c = tok_nextc(tok); diff --git a/Python/ceval.c b/Python/ceval.c index df6f0e9..f198da1 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -14,10 +14,6 @@ #include "opcode.h" #include "structmember.h" -#ifdef macintosh -#include "macglue.h" -#endif - #include /* Turn this on if your compiler chokes on the big switch: */ @@ -801,7 +797,7 @@ eval_frame(PyFrameObject *f) goto on_error; } } -#if !defined(HAVE_SIGNAL_H) || defined(macintosh) +#if !defined(HAVE_SIGNAL_H) /* If we have true signals, the signal handler will call Py_AddPendingCall() so we don't have to call PyErr_CheckSignals(). On the diff --git a/Python/errors.c b/Python/errors.c index 4d88d2d..6416ff3 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -3,12 +3,6 @@ #include "Python.h" -#ifdef macintosh -extern char *PyMac_StrError(int); -#undef strerror -#define strerror PyMac_StrError -#endif /* macintosh */ - #ifndef __STDC__ #ifndef MS_WINDOWS extern char *strerror(int); diff --git a/Python/import.c b/Python/import.c index 50b28ef..77a5605 100644 --- a/Python/import.c +++ b/Python/import.c @@ -11,9 +11,6 @@ #include "eval.h" #include "osdefs.h" #include "importdl.h" -#ifdef macintosh -#include "macglue.h" -#endif #ifdef HAVE_FCNTL_H #include @@ -835,9 +832,6 @@ write_compiled_module(PyCodeObject *co, char *cpathname, long mtime) fclose(fp); if (Py_VerboseFlag) PySys_WriteStderr("# wrote %s\n", cpathname); -#ifdef macintosh - PyMac_setfiletype(cpathname, 'Pyth', 'PYC '); -#endif } @@ -1123,13 +1117,6 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, strcat(buf, "."); strcat(buf, name); strcpy(name, buf); -#ifdef macintosh - /* Freezing on the mac works different, and the modules are - ** actually on sys.path. So we don't take the quick exit but - ** continue with the normal flow. - */ - path = NULL; -#else if (find_frozen(name) != NULL) { strcpy(buf, name); return &fd_frozen; @@ -1137,7 +1124,6 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, PyErr_Format(PyExc_ImportError, "No frozen submodule named %.200s", name); return NULL; -#endif } if (path == NULL) { if (is_builtin(name)) { @@ -1233,33 +1219,6 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, /* no hook was successful, use builtin import */ } -#ifdef macintosh - /* - ** Speedup: each sys.path item is interned, and - ** FindResourceModule remembers which items refer to - ** folders (so we don't have to bother trying to look - ** into them for resources). We only do this for string - ** items. - */ - if (PyString_Check(PyList_GET_ITEM(path, i))) { - PyString_InternInPlace(&PyList_GET_ITEM(path, i)); - v = PyList_GET_ITEM(path, i); - if (PyMac_FindResourceModule((PyStringObject *)v, name, buf)) { - static struct filedescr resfiledescr = - {"", "", PY_RESOURCE}; - - Py_XDECREF(copy); - return &resfiledescr; - } - if (PyMac_FindCodeResourceModule((PyStringObject *)v, name, buf)) { - static struct filedescr resfiledescr = - {"", "", PY_CODERESOURCE}; - - Py_XDECREF(copy); - return &resfiledescr; - } - } -#endif if (len > 0 && buf[len-1] != SEP #ifdef ALTSEP && buf[len-1] != ALTSEP @@ -1290,10 +1249,6 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, } #endif #endif -#ifdef macintosh - fdp = PyMac_FindModuleExtension(buf, &len, name); - if (fdp) { -#else #if defined(PYOS_OS2) /* take a snapshot of the module spec for restoration * after the 8 character DLL hackery @@ -1331,7 +1286,6 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, strcpy(buf+len, fdp->suffix); if (Py_VerboseFlag > 1) PySys_WriteStderr("# trying %s\n", buf); -#endif /* !macintosh */ filemode = fdp->mode; if (filemode[0] == 'U') filemode = "r" PY_STDIOTEXTMODE; @@ -1408,9 +1362,6 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, #elif defined(DJGPP) #include -#elif defined(macintosh) -#include - #elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H) #include #include @@ -1475,24 +1426,6 @@ case_ok(char *buf, int len, int namelen, char *name) } return strncmp(ffblk.ff_name, name, namelen) == 0; -/* macintosh */ -#elif defined(macintosh) - FSSpec fss; - OSErr err; - - if (Py_GETENV("PYTHONCASEOK") != NULL) - return 1; - - err = FSMakeFSSpec(0, 0, Pstring(buf), &fss); - if (err) { - PyErr_Format(PyExc_NameError, - "Can't find file for module %.100s\n(filename %.300s)", - name, buf); - return 0; - } - return fss.name[0] >= namelen && - strncmp(name, (char *)fss.name+1, namelen) == 0; - /* new-fangled macintosh (macosx) */ #elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H) DIR *dirp; @@ -1709,15 +1642,6 @@ load_module(char *name, FILE *fp, char *buf, int type, PyObject *loader) break; #endif -#ifdef macintosh - case PY_RESOURCE: - m = PyMac_LoadResourceModule(name, buf); - break; - case PY_CODERESOURCE: - m = PyMac_LoadCodeResourceModule(name, buf); - break; -#endif - case PKG_DIRECTORY: m = load_package(name, buf); break; @@ -2678,21 +2602,6 @@ imp_load_source(PyObject *self, PyObject *args) return m; } -#ifdef macintosh -static PyObject * -imp_load_resource(PyObject *self, PyObject *args) -{ - char *name; - char *pathname; - PyObject *m; - - if (!PyArg_ParseTuple(args, "ss:load_resource", &name, &pathname)) - return NULL; - m = PyMac_LoadResourceModule(name, pathname); - return m; -} -#endif /* macintosh */ - static PyObject * imp_load_module(PyObject *self, PyObject *args) { @@ -2822,9 +2731,6 @@ static PyMethodDef imp_methods[] = { {"load_dynamic", imp_load_dynamic, METH_VARARGS}, #endif {"load_package", imp_load_package, METH_VARARGS}, -#ifdef macintosh - {"load_resource", imp_load_resource, METH_VARARGS}, -#endif {"load_source", imp_load_source, METH_VARARGS}, {NULL, NULL} /* sentinel */ }; diff --git a/Python/pythonrun.c b/Python/pythonrun.c index c09a3ff..ed54ab3 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -27,9 +27,6 @@ #include "windows.h" #endif -#ifdef macintosh -#include "macglue.h" -#endif extern char *Py_GetPath(void); extern grammar _PyParser_Grammar; /* From graminit.c */ @@ -755,13 +752,6 @@ maybe_pyc_file(FILE *fp, const char* filename, const char* ext, int closeit) if (strcmp(ext, ".pyc") == 0 || strcmp(ext, ".pyo") == 0) return 1; -#ifdef macintosh - /* On a mac, we also assume a pyc file for types 'PYC ' and 'APPL' */ - if (PyMac_getfiletype((char *)filename) == 'PYC ' - || PyMac_getfiletype((char *)filename) == 'APPL') - return 1; -#endif /* macintosh */ - /* Only look into the file if we are allowed to close it, since it then should also be seekable. */ if (closeit) { @@ -1542,11 +1532,7 @@ Py_Exit(int sts) { Py_Finalize(); -#ifdef macintosh - PyMac_Exit(sts); -#else exit(sts); -#endif } static void diff --git a/Python/strerror.c b/Python/strerror.c index aeb7dd5..55f8342 100644 --- a/Python/strerror.c +++ b/Python/strerror.c @@ -17,8 +17,3 @@ strerror(int err) PyOS_snprintf(buf, sizeof(buf), "Unknown errno %d", err); return buf; } - -#ifdef macintosh -int sys_nerr = 0; -char *sys_errlist[1] = 0; -#endif diff --git a/Python/structmember.c b/Python/structmember.c index 34310b8..bbaaca8 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -103,23 +103,6 @@ PyMember_GetOne(char *addr, PyMemberDef *l) case T_STRING_INPLACE: v = PyString_FromString((char*)addr); break; -#ifdef macintosh - case T_PSTRING: - if (*(char**)addr == NULL) { - Py_INCREF(Py_None); - v = Py_None; - } - else - v = PyString_FromStringAndSize( - (*(char**)addr)+1, - **(unsigned char**)addr); - break; - case T_PSTRING_INPLACE: - v = PyString_FromStringAndSize( - ((char*)addr)+1, - *(unsigned char*)addr); - break; -#endif /* macintosh */ case T_CHAR: v = PyString_FromStringAndSize((char*)addr, 1); break; @@ -168,11 +151,7 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) { PyObject *oldv; - if ((l->flags & READONLY) || l->type == T_STRING -#ifdef macintosh - || l->type == T_PSTRING -#endif - ) + if ((l->flags & READONLY) || l->type == T_STRING) { PyErr_SetString(PyExc_TypeError, "readonly attribute"); return -1; -- cgit v0.12