From 2f20d0b140bc3251324d3dc0d7ff7c4441fefd7f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 14 May 2015 21:52:23 +0000 Subject: [PATCH] [CRT] Don't use _control87 on ARM builds svn path=/trunk/; revision=67728 --- reactos/lib/sdk/crt/string/scanf.h | 11 ++++++++--- reactos/lib/sdk/crt/string/winesup.c | 12 ++++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/reactos/lib/sdk/crt/string/scanf.h b/reactos/lib/sdk/crt/string/scanf.h index fe272c9f05b..cca73947cb4 100644 --- a/reactos/lib/sdk/crt/string/scanf.h +++ b/reactos/lib/sdk/crt/string/scanf.h @@ -407,11 +407,14 @@ _FUNCTION_ { /* ReactOS: don't inline float processing (kernel/freeldr don't like that! */ _internal_handle_float(negative, exp, suppress, d, l_prefix || L_prefix, &ap); st = 1; +#else +#ifdef _M_ARM + DbgBreakPoint(); #else fpcontrol = _control87(0, 0); _control87(MSVCRT__EM_DENORMAL|MSVCRT__EM_INVALID|MSVCRT__EM_ZERODIVIDE |MSVCRT__EM_OVERFLOW|MSVCRT__EM_UNDERFLOW|MSVCRT__EM_INEXACT, 0xffffffff); - +#endif negexp = (exp < 0); if(negexp) exp = -exp; @@ -423,9 +426,11 @@ _FUNCTION_ { expcnt = expcnt*expcnt; } cur = (negexp ? d/cur : d*cur); - +#ifdef _M_ARM + DbgBreakPoint(); +#else _control87(fpcontrol, 0xffffffff); - +#endif st = 1; if (!suppress) { if (L_prefix) _SET_NUMBER_(double); diff --git a/reactos/lib/sdk/crt/string/winesup.c b/reactos/lib/sdk/crt/string/winesup.c index b20691d8ffe..8cc7679ecd5 100644 --- a/reactos/lib/sdk/crt/string/winesup.c +++ b/reactos/lib/sdk/crt/string/winesup.c @@ -75,11 +75,14 @@ _internal_handle_float( long double cur = 1, expcnt = 10; unsigned fpcontrol; BOOL negexp; - +#ifdef _M_ARM + DbgBreakPoint(); + fpcontrol = _controlfp(0, 0); +#else fpcontrol = _control87(0, 0); _control87(_EM_DENORMAL|_EM_INVALID|_EM_ZERODIVIDE |_EM_OVERFLOW|_EM_UNDERFLOW|_EM_INEXACT, 0xffffffff); - +#endif negexp = (exp < 0); if(negexp) exp = -exp; @@ -92,7 +95,12 @@ _internal_handle_float( } cur = (negexp ? d/cur : d*cur); +#ifdef _M_ARM + DbgBreakPoint(); + _controlfp(fpcontrol, 0xffffffff); +#else _control87(fpcontrol, 0xffffffff); +#endif if (!suppress) { if (l_or_L_prefix) _SET_NUMBER_(double);