lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



It believe it is platform independent assuming that the float format is
the same on both platforms (or emulation). Lua should handle endianess
for you.
You should make sure that llimits.h has the same parameters, and you are
using the same flags (e.g. Lua number format) for both the Palm Lua
target and the win32 luac exe.
You should be able to just "do" the binary string as Lua should
recognise it as a Lua binary.
It would appear to be slightly more complicated than this. I can succesfully run precompiled chunks on Win32 and PocketPC (where ints are both 32bit) but my 16bit PalmOS Lua refuses to run chunks compiled on Win32. I have built with USE_LONG and USE_DOUBLE just to make sure the output from luac is different in each case, which it is.

Forcing BITS_INT to be 16 in lua.h does not change the bytecode, longs are 32bit on Win32 and PalmOS so that might be what you would expect but the function below looks problematic to me when writing a cross compiler to generate bytecode for a 16bit platform:

static void DumpInt(int x, DumpState* D)
{
 DumpBlock(&x,sizeof(x),D);
}

It is easily rewritten as:
static void DumpInt(int x, DumpState* D)
{
 short s = (short)x;
 DumpBlock(&s,sizeof(s),D);
}

This indeed does change the size of the resulting bytecode but my simple precompiled script still fails when I call lua_dobuffer, the same script that runs fine on two different 32bit platforms. Has anyone got any insight into what else might be lurking in the dump and undump code that might need changing to make a luac that runs on Win32 to generate bytecode for PalmOS16.

Cheers.







Nick




==============================================
This message has been scanned for viruses and
dangerous content by the IC-MailScanner, and is
believed to be clean.
see http://www.internet-central.net for details
==============================================





==============================================
This message has been scanned for viruses and
dangerous content by the IC-MailScanner, and is
believed to be clean.
see http://www.internet-central.net for details
==============================================