[Vm-dev] VM_PROXY_ version testing

Alistair Grant akgrant0710 at gmail.com
Sun Dec 30 17:29:12 UTC 2018


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?

Thanks,
Alistair


More information about the Vm-dev mailing list