I choose Lua 5.1 as my built-in scripting language, but when I port the application to the legacy platform, it starts LynxOS on PowerPC, the thing seems wrong.
I get the following code that runs on a PC and everything looks good:
void test_lua() { const char *code = "foo = 5\n"; double vfoo=0; lua_State *L = luaL_newstate(); (void)luaL_loadbuffer(L, code, strlen(code), "line"); (void)lua_pcall (L, 0, 0, 0); lua_getglobal(L, "foo"); vfoo = lua_tonumber(L, -1); lua_close(L); myTrace("vfoo = %f", vfoo); for(;;); }
from PC (Visual C ++ 6.0) I was expecting "vfoo = 5.000000"
But with LynxOS / PowerPC, I got "vfoo = 0.000000".
So what is happening for Lua on LynxOS / PowerPC? I am wondering if there are any configurations for a large-core machine, I looked for it in "luaconf.h", but did not find anything. I also tried the configuration item "LUA_USE_POSIX", but did not help.
I know this is not a typical lua programming platform. However, any suggestions are welcome and appreciated.
Haiyuan li
source share