views:

58

answers:

0

I have a several-thousand-line application that relies on SIGFPE (handled by a function pointer passed to signal()) to change state and have the code run correctly when certain floating point conditions happen. However, under C++/CLI in managed-mode, _control87 generates a System.ArithmeticException executing in a static lib written in C. _fpreset and _control87 are not supported.

How do I get classic, unmanaged SIGFPE operation to work in a C++/CLI application? The number of locations where floating point stuff happens in my application could be immense and I do not fully understand all of the numerical methods written years ago by other programmers.

I want old-school exception handling to work on a floating point division by zero, not an INF value. Platform invoke style doesn't work, and #pragma managed(off) doesn't do the trick either.

What options do I have?