11/*
2- ** Mac shared lib glue.
2+ ** Shared library initialization code.
3+ **
4+ ** This code calls the MetroWerks shared-library initialization code
5+ ** and performs one extra step: it remembers the FSSpec of the file
6+ ** we are loaded from, so we can later call PyMac_AddLibResources to
7+ ** add the file to our resource file chain.
8+ **
9+ ** This file is needed for PythonCore and for any dynamically loaded
10+ ** module that has interesting resources in its .slb file.
11+ ** Use by replacing __initialize in the "CFM preferences" init field
12+ ** by __initialize_with_resources.
313*/
414
515#include <Quickdraw.h>
818#include <Files.h>
919#include <Resources.h>
1020
11- #ifdef __MWERKS__
12- #ifdef PRE_CW8
13- /*
14- ** This part is copied from MW Startup.c, which is
15- ** Copyright © 1993 metrowerks inc. All Rights Reserved.
16- */
17- #include <setjmp.h>
18- #include <stdio.h>
19-
20- /* void *__local_destructor_chain; /* chain of local objects that need destruction */
21-
22- /* public data */
23-
24- QDGlobals qd ; /* define the Quickdraw globals here! */
25- jmp_buf __program_exit ; /* exit() does a longjmp() to here */
26- void (* __atexit_hook )(void ); /* atexit() sets this up if it is ever called */
27- void (* ___atexit_hook )(void ); /* _atexit() sets this up if it is ever called */
28- int __aborting ; /* abort() sets this and longjmps to __program_exit */
29- #endif
30- #endif
3121
3222/*
3323** Variables passed from shared lib initialization to PyMac_AddLibResources.
@@ -40,10 +30,11 @@ static FSSpec library_fss;
4030** loaded. We always return noErr (we just continue without the resources).
4131*/
4232OSErr pascal
43- PythonCore_init (InitBlockPtr data )
33+ __initialize_with_resources (InitBlockPtr data )
4434{
4535 /* Call the MW runtime's initialization routine */
46- #ifdef __CFM68K__
36+ /* #ifdef __CFM68K__ */
37+ #if 1
4738 __initialize ();
4839#else
4940 __sinit ();
0 commit comments