lua-users home
lua-l archive

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


Shmuel Zeigerman wrote:
> FWIW, the lines in luaconf.h cited below are what cause exceptions after  
> a Delphi DLL is loaded. This explains why lua5.1.dll built with GCC  
> happens to work in this situation: it doesn't contain those lines.
>
>> /* On a Microsoft compiler, use assembler */
>> #if defined(_MSC_VER)
>>
>> #define lua_number2int(i,d)   __asm fld d   __asm fistp i

Lua is not at fault here. The Borland/Delphi runtime modifies the
FPU control word and enables FP exceptions. This violates the
Windows ABI and causes plenty of interoperability problems:

  http://www.virtualdub.org/blog/pivot/entry.php?id=53

--Mike