[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Incompatibility of lua5.1.dll (from Lua Binaries) and Delphi
- From: Mike Pall <mikelu-0903@...>
- Date: Wed, 18 Mar 2009 14:20:54 +0100
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