lua-users home
lua-l archive

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


Long Cheng wrote:
> Put into lua 5.1.4 source and build as static lib. Works well in our server
> side code. Failed in client side code at first attempt, then after I added
> the D3DCREATE_FPU_PRESERVE flag it is working now. I noticed the self-test
> code in luaopen_bit function, but unfortunately our application initialize
> lua vm before DX, so the test always passes.

Ah yes, I see the problem. But there's not much I can do about the
initialization order.

You would have gotten into problems with the wrong DirectX
initialization, anyway. Assuming the compiler generates x87 and
not SSE2 code for FP arithmetics, even simple additions in Lua
will break. Try:

  local x=1
  print(1000000000+x)

It should print 1000000001 (correct) and not 1000000000 (wrong FPU
flags).

Thank you for the report!

--Mike