I've got a weird situation where using a 3D engine dll created in VS
C++ with delphi causes a floating point error.
the test program crashes in Delphi5 but when the exact same code is
compiled in D6,D7,D2005,D2006 or D007 it works okay.
I'm pretty sure it's the issue of the fpu control word being different
for delphi versus vs c++.
before I hit the instruction that causes problems in the dll:
in D5 the control word is $133F
in D6 the control word is $1332
in D7 the control word is $107F
in D2005 the control word is $107F
in D2006 the control word is $107F
in D2007 the control word is $107F
looking at system.pas I don't see a difference that would account for
this. Anybody have an idea if there was a change in Delphi 6+ that is
allowing this to work from what I can see Default8087CW: Word =
$1332; for all D5->D2007. , >> I realized the culprit was actually the Delphi Trunc function.
"Anders Isaksson" wrote
> Not really. The DLL is still the culprit, as it changes the CW to
> exceptions. The problem only surfaces later when Trunc sets/resets
> CW and the masked exception (from the DLL) is suddenly unmasked.
Anders and Jens,
VIEWS ON THIS POST
Friday 21st September 2012