Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3089b7e

Browse files
committed
- Various names in CodeFragments.h have changed
- a dummy main program was added, so we can use the standard MW MSL runtime library for main programs (in stead of rolling our own, as we did previously).
1 parent eeccca9 commit 3089b7e

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

Mac/Python/macshlglue.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ PERFORMANCE OF THIS SOFTWARE.
4343
** by __initialize_with_resources.
4444
*/
4545

46+
#include <Types.h>
4647
#include <Quickdraw.h>
4748
#include <SegLoad.h>
4849
#include <CodeFragments.h>
4950
#include <Files.h>
5051
#include <Resources.h>
5152

52-
5353
/*
5454
** Variables passed from shared lib initialization to PyMac_AddLibResources.
5555
*/
@@ -61,7 +61,7 @@ static FSSpec library_fss;
6161
** loaded. We always return noErr (we just continue without the resources).
6262
*/
6363
OSErr pascal
64-
__initialize_with_resources(InitBlockPtr data)
64+
__initialize_with_resources(CFragInitBlockPtr data)
6565
{
6666
/* Call the MW runtime's initialization routine */
6767
/* #ifdef __CFM68K__ */
@@ -72,10 +72,10 @@ __initialize_with_resources(InitBlockPtr data)
7272
#endif
7373

7474
if ( data == nil ) return noErr;
75-
if ( data->fragLocator.where == kOnDiskFlat ) {
75+
if ( data->fragLocator.where == kDataForkCFragLocator ) {
7676
library_fss = *data->fragLocator.u.onDisk.fileSpec;
7777
library_fss_valid = 1;
78-
} else if ( data->fragLocator.where == kOnDiskSegmented ) {
78+
} else if ( data->fragLocator.where == kResourceCFragLocator ) {
7979
library_fss = *data->fragLocator.u.inSegs.fileSpec;
8080
library_fss_valid = 1;
8181
}
@@ -95,3 +95,16 @@ PyMac_AddLibResources()
9595
(void)FSpOpenResFile(&library_fss, fsRdPerm);
9696
}
9797

98+
/*
99+
** Dummy main() program to keep linker happy: we want to
100+
** use the MW AppRuntime in our shared library (better than building
101+
** custom runtime libraries as we did before) but AppRuntime
102+
** expects a main program. Note that it
103+
*/
104+
105+
#pragma export off
106+
int
107+
main(int argc, char **argv) {
108+
DebugStr("\pCannot happen: PythonCore dummy main called!");
109+
}
110+
#pragma export reset

0 commit comments

Comments
 (0)