[Vm-dev] Re: Problem compiling Mac VM

David T. Lewis lewis at mail.msen.com
Fri Apr 30 03:51:54 UTC 2010

On Thu, Apr 29, 2010 at 08:59:45PM +0200, Mariano Martinez Peck wrote:
> On Thu, Apr 29, 2010 at 7:13 PM, Eliot Miranda <eliot.miranda at gmail.com>wrote:
> >
> > On Thu, Apr 29, 2010 at 10:07 AM, Eliot Miranda <eliot.miranda at gmail.com>wrote:
> >
> >> error was recently moved out of VMMaker (interp.c) and into the support
> >> code.  You need to update the svn side of things.
> >
> > I see a definition of error in platforms/win32/vm/sqWin32Intel.c but none
> > in platforms/Mac OS/vm/sqMacMain.c or platforms/unix/vm/sqUnixMain.c.
> >  Something like this should serve:
> Thanks Eliot. Indeed, that worked. Or at least, I could compile, link and
> run an image. Now I wonder how this kind of changes (those changes to
> VMMaker that require changes in all platform code support) are managed and
> synchronized so that to avoid this kind of problems.
> Is there a procedure for this ?


I don't know that there is any simple answer to this, but to take the
error() function as a specific example, here is how it was handled:

- The error() function was originally implemented in code that was
  genererated by VMMaker. Someone pointed out (on the vm-dev list) that
  this was a bad idea.

- We renamed the original error() implementation as defaultErrorProc(),
  which is now generated by CCodeGenerator>>emitCHeaderOn:

- We used a CPP macro for error (see CCodeGenerator>>emitDefaultMacrosOn:).
  If the macro is not defined then error is defined as defaultErrorProc,
  which is the original implementation.

- If the platform code provides its own implementation of error(), it
  defines the error macro to point to it. Typically this may be done
  in the config.h header.

The end result is that the new version of VMMaker generated code will
use the implementation of error() that is provided by the platforms
sources if possible, but if this is not available it uses the original
implementation in defaultErrorProc. If the platform code does not provide
an error() function, then everything works it did before the change.

I suspect that you have discovered some combination of platform
sources, configuration files, etc that breaks this, but the intent
was to make the change in such a way as to provide backward compatibility
even if all of the various platform sources were not updated immediately.


More information about the Vm-dev mailing list