I'm writing a small app that runs on MacOS 7.x - 9.x (using Macintosh Toolbox) and I've decided to include Duktape.
I use CodeWarrior 6.0 running on MacOS 9.
I use the Low Memory configuration, found here.
It runs perfectly when I compile for PPC - but when I compile for 68k I'm getting a lot strange behaviour and crashes.
For example, if I were to call duk_peval_string
with the following:
var i = 3;
<- no errors
var i = 3; function a() { return 4; }
<- no errors
var i = 3; function a() { return 4; } i = a();
<-- "ReferenceError: -4e+0"
function a() { return 4; } i = a();
<-- crash on start
I've enabled the self tests (DUK_USE_SELF_TESTS
) to try to figure out what might be going on - enabling 8-Byte Doubles
and changing the Struct Alignment
to PowerPC
(instead of 68K settings) under processor settings cause Duktape to pass the tests - but it still doesn't fix the problem.
Defining __m68k__
(or not) doesn't seem to affect anything.
I know it's a long shot, but after spending ~4 hours changing almost every setting I can find on the IDE and duk_config, I'm out of ideas - so any help would be much appreciated.