News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

f2c library

Started by frankie, January 09, 2007, 06:45:15 PM

Previous topic - Next topic

frankie

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:
_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

Pelle

Something like this will probably work, but I can't see that it will add very much to the party...

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