[Vm-dev] VM_PROXY_ version testing

Eliot Miranda eliot.miranda at gmail.com
Sun Dec 30 17:34:01 UTC 2018


Hi Alistair,


> On Dec 30, 2018, at 9:29 AM, Alistair Grant <akgrant0710 at gmail.com> wrote:
> 
> 
> Hi All,
> 
> Recent versions of vmmaker are generating code similar to:
> 
> #if VM_PROXY_MAJOR > 1 || (VM_PROXY_MAJOR == 1 && VM_PROXY_MINOR >= 14)
> extern sqInt primitiveFailForOSError(sqLong osError);
> #else
> # define primitiveFailForOSError(osError) 0
> #endif
> 
> 
> This seems quite dangerous as compiling with an earlier version of the
> VM will succeed, but the plugin will behave in strange ways when run.
> Forcing a compiler failure seems like the safer option, e.g. something
> like:
> 
> #error "Not supported on VMs earlier than 1.14"
> 
> What do you think?

That’s one alternative.  Another is

#else
# define primitiveFailForOSError(osError) primitiveFailFor(PrimErrOSError)
#endif

or

#else
# define primitiveFailForOSError(osError) primitiveFailFor(PrimErrUnsupported)
#endif

> Thanks,
> Alistair
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20181230/b593eb8b/attachment.html>


More information about the Vm-dev mailing list