- Properly implement and export _fpcontrol_s

svn path=/trunk/; revision=57823
This commit is contained in:
Jérôme Gardou 2012-12-08 17:44:38 +00:00
parent a7321eec6d
commit f17fe2fe20
2 changed files with 9 additions and 9 deletions

View file

@ -302,7 +302,7 @@
@ extern _commode
@ cdecl _control87(long long)
@ cdecl _controlfp(long long)
# @ cdecl _controlfp_s(ptr long long)
@ cdecl _controlfp_s(ptr long long)
@ cdecl _copysign( double double )
@ varargs _cprintf(str)
# stub _cprintf_l

View file

@ -120,15 +120,15 @@ unsigned int CDECL _control87(unsigned int newval, unsigned int mask)
int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask)
{
#ifdef __i386__
unsigned int flags;
FIXME("(%p %u %u) semi-stub\n", cur, newval, mask);
flags = _control87( newval, mask & ~_EM_DENORMAL );
if(cur)
*cur = flags;
unsigned int val;
if (!MSVCRT_CHECK_PMT( !(newval & mask & ~(_MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC | _MCW_DN))))
{
if (cur) *cur = _controlfp( 0, 0 ); /* retrieve it anyway */
return MSVCRT_EINVAL;
}
val = _controlfp( newval, mask );
if (cur) *cur = val;
return 0;
#else
FIXME(":Not Implemented!\n");