From bfd0866be888d4f4e5e731615bad14aaa8a83616 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 1 Apr 2010 12:41:06 +0200 Subject: [PATCH] msvcrt: Added implementation of _controlfp_s. --- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/math.c | 21 +++++++++++++++++++++ dlls/msvcrt/msvcrt.spec | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index b48656e9fa5..b8876a4ac2a 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -327,7 +327,7 @@ @ stub _configthreadlocale @ cdecl _control87(long long) msvcrt._control87 @ cdecl _controlfp(long long) msvcrt._controlfp -@ stub _controlfp_s +@ cdecl _controlfp_s(ptr long long) msvcrt._controlfp_s @ cdecl _copysign( double double ) msvcrt._copysign @ varargs _cprintf(str) msvcrt._cprintf @ stub _cprintf_l diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index fd6c8df2cc5..dfb951cb3bd 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -319,7 +319,7 @@ @ stub _configthreadlocale @ cdecl _control87(long long) msvcrt._control87 @ cdecl _controlfp(long long) msvcrt._controlfp -@ stub _controlfp_s +@ cdecl _controlfp_s(ptr long long) msvcrt._controlfp_s @ cdecl _copysign( double double ) msvcrt._copysign @ varargs _cprintf(str) msvcrt._cprintf @ stub _cprintf_l diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 317c8eb7d29..fb2cd86565a 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -701,6 +701,27 @@ unsigned int CDECL _controlfp(unsigned int newval, unsigned int mask) #endif } +/********************************************************************* + * _controlfp_s (MSVCRT.@) + */ +int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask) +{ + unsigned int flags; +#ifdef __i386__ + FIXME("(%p %u %u) semi-stub\n", cur, newval, mask); + + flags = _control87( newval, mask & ~MSVCRT__EM_DENORMAL ); + + if(cur) + *cur = flags; + + return 0; +#else + FIXME(":Not Implemented!\n"); + return 0; +#endif +} + /********************************************************************* * _copysign (MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 762563ef7a7..7205bd6a146 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -299,7 +299,7 @@ @ extern _commode MSVCRT__commode @ cdecl _control87(long long) @ cdecl _controlfp(long long) -# stub _controlfp_s +@ cdecl _controlfp_s(ptr long long) @ cdecl _copysign( double double ) @ varargs _cprintf(str) # stub _cprintf_l