summaryrefslogtreecommitdiffstats
path: root/Mac/mwerks
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-02-20 16:26:19 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-02-20 16:26:19 (GMT)
commiteb263680bb4e01371e38f4063b7bdbf156ee7e72 (patch)
tree06698e1e0fb8056dd82a47cc21224f584657e267 /Mac/mwerks
parent56ed26ed118fffb85d6ed0bc350165da40e5051f (diff)
downloadcpython-eb263680bb4e01371e38f4063b7bdbf156ee7e72.zip
cpython-eb263680bb4e01371e38f4063b7bdbf156ee7e72.tar.gz
cpython-eb263680bb4e01371e38f4063b7bdbf156ee7e72.tar.bz2
Ported to CW8
Diffstat (limited to 'Mac/mwerks')
-rw-r--r--Mac/mwerks/macuseshlstart.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/Mac/mwerks/macuseshlstart.c b/Mac/mwerks/macuseshlstart.c
index d26a89f..32b808a 100644
--- a/Mac/mwerks/macuseshlstart.c
+++ b/Mac/mwerks/macuseshlstart.c
@@ -7,15 +7,30 @@
#include <setjmp.h>
+#ifdef PRE_CW8
extern jmp_buf __program_exit; /* exit() does a longjmp() to here */
extern void (*__atexit_hook)(void); /* atexit() sets this up if it is ever called */
extern void (*___atexit_hook)(void); /* _atexit() sets this up if it is ever called */
extern int __aborting; /* abort() sets this and longjmps to __program_exit */
+#endif
+
+/*
+ * clear_stackframe_backlink - set 0(SP) to 0
+ *
+ */
+
+static asm void clear_stackframe_backlink(void)
+{
+ li r3,0
+ stw r3,0(SP)
+ blr
+}
void __start(void)
{
char *argv = 0;
+#ifdef PRE_CW8
if (setjmp(__program_exit) == 0) { // set up jmp_buf for exit()
main(0, &argv); // call main(argc, argv)
if (__atexit_hook)
@@ -26,4 +41,9 @@ void __start(void)
___atexit_hook(); // call _atexit() procs
}
// ExitToShell();
+#else
+ clear_stackframe_backlink();
+ main(0, &argv);
+ exit(0);
+#endif
}