lua-users home
lua-l archive

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


I choose Lua 5.1 as my application's embedded scripting language, but when I port the application to a legacy platform runs LynxOS 3.1 on PowerPC,

things seems going wrong.

I get following code run up on 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(;;);

}

with PC (Visual C++ 6.0) I got expecting "vfoo = 5.000000"

But with LynxOS/PowerPC I got "vfoo = 0.000000".

So what's going on for Lua on LynxOS/PowerPC ? I am wondering if there are some configurations for big-endian machine, I looked for it in "luaconf.h" but find nothing. I also tried the configuration item "LUA_USE_POSIX" but no help.

I know it's not a typical platform for lua programming. However, any suggestions are welcome and be appreciated.

 

 

Samuel Li