summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-08-01 15:23:54 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-08-01 15:23:54 (GMT)
commitd1f06313f6702ae629f4b6c815eb3b81e4440b72 (patch)
tree257b8a15dcc8503d1c5030142a53201717310938
parent64d376a67076b6b8f38a8e9197b10660b9d6d5eb (diff)
downloadcpython-d1f06313f6702ae629f4b6c815eb3b81e4440b72.zip
cpython-d1f06313f6702ae629f4b6c815eb3b81e4440b72.tar.gz
cpython-d1f06313f6702ae629f4b6c815eb3b81e4440b72.tar.bz2
- Minimum stacksize is now 8K for PPC, 4K for 68K
- Added PyMac_BuildNumVersion
-rw-r--r--Mac/Python/macglue.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c
index e0cbd1a..e6739b5 100644
--- a/Mac/Python/macglue.c
+++ b/Mac/Python/macglue.c
@@ -65,6 +65,18 @@ typedef FileFilterYDProcPtr FileFilterYDUPP;
#include <stdio.h>
/*
+** When less than this amount of stackspace is left we
+** raise a MemoryError.
+*/
+#ifndef MINIMUM_STACK_SIZE
+#ifdef __powerc
+#define MINIMUM_STACK_SIZE 8192
+#else
+#define MINIMUM_STACK_SIZE 4096
+#endif
+#endif
+
+/*
** We have to be careful, since we can't handle
** things like updates (and they'll keep coming back if we don't
** handle them). Note that we don't know who has windows open, so
@@ -140,12 +152,6 @@ PyMac_FixGUSIcd()
pb.ioWDDirID= curdirfss.parID;
if (PBHSetVol(&pb, 0) != noErr)
return;
-
-#if 0
- /* Set standard-file working directory */
- LMSetSFSaveDisk(-curdirfss.vRefNum);
- LMSetCurDirStore(curdirfss.parID);
-#endif
}
#endif
@@ -233,7 +239,7 @@ PyOS_CheckStack()
long left;
left = StackSpace();
- if ( left < 4000 )
+ if ( left < MINIMUM_STACK_SIZE )
return -1;
return 0;
}
@@ -650,6 +656,13 @@ PyMac_BuildOSType(OSType t)
return PyString_FromStringAndSize((char *)&t, 4);
}
+/* Convert an NumVersion value to a 4-element tuple */
+PyObject *
+PyMac_BuildNumVersion(NumVersion t)
+{
+ return Py_BuildValue("(hhhh)", t.majorRev, t.minorAndBugRev, t.stage, t.nonRelRev);
+}
+
/* Convert a Python string object to a Str255 */
int