@@ -64,6 +64,18 @@ typedef FileFilterYDProcPtr FileFilterYDUPP;
6464#include <signal.h>
6565#include <stdio.h>
6666
67+ /*
68+ ** When less than this amount of stackspace is left we
69+ ** raise a MemoryError.
70+ */
71+ #ifndef MINIMUM_STACK_SIZE
72+ #ifdef __powerc
73+ #define MINIMUM_STACK_SIZE 8192
74+ #else
75+ #define MINIMUM_STACK_SIZE 4096
76+ #endif
77+ #endif
78+
6779/*
6880** We have to be careful, since we can't handle
6981** things like updates (and they'll keep coming back if we don't
@@ -140,12 +152,6 @@ PyMac_FixGUSIcd()
140152 pb .ioWDDirID = curdirfss .parID ;
141153 if (PBHSetVol (& pb , 0 ) != noErr )
142154 return ;
143-
144- #if 0
145- /* Set standard-file working directory */
146- LMSetSFSaveDisk (- curdirfss .vRefNum );
147- LMSetCurDirStore (curdirfss .parID );
148- #endif
149155}
150156#endif
151157
@@ -233,7 +239,7 @@ PyOS_CheckStack()
233239 long left ;
234240
235241 left = StackSpace ();
236- if ( left < 4000 )
242+ if ( left < MINIMUM_STACK_SIZE )
237243 return -1 ;
238244 return 0 ;
239245}
@@ -650,6 +656,13 @@ PyMac_BuildOSType(OSType t)
650656 return PyString_FromStringAndSize ((char * )& t , 4 );
651657}
652658
659+ /* Convert an NumVersion value to a 4-element tuple */
660+ PyObject *
661+ PyMac_BuildNumVersion (NumVersion t )
662+ {
663+ return Py_BuildValue ("(hhhh)" , t .majorRev , t .minorAndBugRev , t .stage , t .nonRelRev );
664+ }
665+
653666
654667/* Convert a Python string object to a Str255 */
655668int
0 commit comments