Pelles C forum

C language => User contributions => Topic started by: frankie on January 09, 2007, 06:45:15 PM

Title: f2c library
Post by: frankie on January 09, 2007, 06:45:15 PM
This is the full project under PelleC for the fortran library for the AT&T f2c fortran to C translator.
The only problem is in the module "unint.c", I was bothered to look for the PellesC equivalent, if any exists, of the function:
Code: [Select]
_control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
If you have time to fix, please do and let me know.  :mrgreen:
Title: f2c library
Post by: Pelle on January 10, 2007, 04:57:20 PM
Something like this will probably work, but I can't see that it will add very much to the party...

Code: [Select]
void __declspec(naked) __cdecl _update_x87_control_word(void)
{
    __asm {
        sub esp, 4
        fstcw WORD PTR [esp]
        or WORD PTR [esp], (0x0002 /*denormal*/)|(0x0010 /*underflow*/)|(0x0020 /*inexact*/);
        fldcw WORD PTR [esp]
        add esp, 4
        ret
    }
}