Building the VM with MPW

Bob Arning arning at charm.net
Fri Nov 6 00:40:53 UTC 1998


On Wed, 4 Nov 1998 23:29:50 -0700 Jeffrey Chapman <dahuang at geocities.com> wrote: 
>Does anyone have an MPW project for a 2.2 VM they would like to share? Or 
>perhaps some tips on building the VM using MPW/MrC? Squeak generated 
>interp.c and supporting files successfully, and MPW attempts to build the 
>VM, but reports some hangups with unused parameters.

Jeffrey,

Here are some notes I made for 2.1 - I don't know how relevant or complete they are for 2.2:

1. The VM was unable to allocate memory for the heap using

#define sqAllocateMemory(minHeapSize, desiredHeapSize)   malloc(desiredHeapSize)

but worked when I used

#define sqAllocateMemory(minHeapSize, desiredHeapSize)   NewPtr(desiredHeapSize)

MacsBug seemed to indicate that there was sufficient memory, but maybe this implementation of malloc() has some limits.

2. I don't seem to have

#include <MacHeaders.h>

but everything went fine when I commented it out.

3. My version of Files.h has several functions marked as obsolete and available only if a certain #define exists. As a result I got 3 or 4 missing symbols on linking. By adding

#define PBOpen(pb, async) ((async) ? PBOpenAsync(pb) : PBOpenSync(pb))
#define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
#define PBRead(pb, async) ((async) ? PBReadAsync(pb) : PBReadSync(pb))
#define PBWrite(pb, async) ((async) ? PBWriteAsync(pb) : PBWriteSync(pb))

to sqMacAsyncFilePrims.c, the errors went away.

4. "qd" was undefined on linking until I added 

static QDGlobals	qd;

to sqMacWindow.c.

5. In sqMacSound.c, the compiler needed the (char *) on the third argument in the following before it would be happy:

MixInSamples(count, (char *) srcBufPtr, 0, (char *)  &bufPlaying->dbSoundData[0], startSample);

and

MixInSamples(count, (char *) srcBufPtr, samplesInserted, (char *)  &otherBuf->dbSoundData[0], 0);

6. In sqMacSound.c, the compiler complained when it tried to define an enum for true and false in the Sound.h until I moved sq.h first in line to third.


If you need a makefile, let me know - it's too geeky for public consumption.

Cheers,
Bob





More information about the Squeak-dev mailing list