diff Mac/Python/macglue.c @ 3914:524cf501c851 legacy-trunk

- Minimum stacksize is now 8K for PPC, 4K for 68K - Added PyMac_BuildNumVersion
author Jack Jansen <jack.jansen@cwi.nl>
date Thu, 01 Aug 1996 15:23:54 +0000
parents 718c8af7be2a
children aa9548885b3f
line wrap: on
line diff
--- a/Mac/Python/macglue.c	Thu Aug 01 01:06:24 1996 +0000
+++ b/Mac/Python/macglue.c	Thu Aug 01 15:23:54 1996 +0000
@@ -65,6 +65,18 @@
 #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 @@
 	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 @@
 	long left;
 	
 	left = StackSpace();
-	if ( left < 4000 )
+	if ( left < MINIMUM_STACK_SIZE )
 		return -1;
 	return 0;
 }
@@ -650,6 +656,13 @@
 	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