NO

Author Topic: f2c library  (Read 4550 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
f2c library
« 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:
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
f2c library
« Reply #1 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
    }
}
/Pelle