diff --git a/libgui/src/octave-interpreter.cc b/libgui/src/octave-interpreter.cc --- a/libgui/src/octave-interpreter.cc +++ b/libgui/src/octave-interpreter.cc @@ -33,6 +33,20 @@ #include "octave-interpreter.h" +#if defined (__MINGW32__) + +#define _MCW_PC 0x00030000 +#define _PC_64 0x00000000 + +extern "C" +{ +/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask), + * i.e. change the bits in unMask to have the values they have in unNew, + * leaving other bits unchanged. */ +_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _controlfp (unsigned int unNew, unsigned int unMask); +} +#endif + void octave_interpreter::execute (void) { @@ -40,6 +54,10 @@ octave_thread_manager::unblock_interrupt_signal (); +#if defined (__MINGW32__) + _controlfp (_PC_64, _MCW_PC); +#endif + octave_initialize_interpreter (octave_cmdline_argc, octave_cmdline_argv, octave_embedded);