Commits

Anonymous committed 1ce07f6

Startup code for applications using the python shared
library. Modified because the startup code has to work together with
the runtime support in the shared library.

Comments (0)

Files changed (1)

Mac/mwerks/macuseshlstart.c

+/*
+** mac __start for python-with-shared-library.
+**
+** Partially stolen from MW Startup.c, which is
+**	Copyright Š 1993 metrowerks inc. All Rights Reserved.
+*/
+
+#include <setjmp.h>
+
+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	*/
+
+void __start(void)
+{
+	char *argv = 0;
+	
+	if (setjmp(__program_exit) == 0) {	//	set up jmp_buf for exit()
+		main(0, &argv);				//	call main(argc, argv)
+		if (__atexit_hook)
+			__atexit_hook();			//	call atexit() procs
+	}
+	if (!__aborting) {
+		if (___atexit_hook)
+			___atexit_hook();			//	call _atexit() procs
+	}
+//	ExitToShell();
+}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.