Piotr Caban : msvcrt: Introduce fenv_decode helper in all runtime versions.

Alexandre Julliard julliard at winehq.org
Wed Jul 21 16:04:30 CDT 2021


Module: wine
Branch: master
Commit: 5189d73b54ffd65e4f3ff9b3c90a8c1a2aa91cc1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5189d73b54ffd65e4f3ff9b3c90a8c1a2aa91cc1

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Jul 21 13:21:18 2021 +0200

msvcrt: Introduce fenv_decode helper in all runtime versions.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/math.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index e61c079f105..2b7249c5451 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -5651,6 +5651,14 @@ static BOOL fenv_decode(__msvcrt_ulong enc, unsigned int *x, unsigned int *y)
     return TRUE;
 }
 #endif
+#elif _MSVCR_VER >= 120
+#if (defined(__i386__) || defined(__x86_64__))
+static BOOL fenv_decode(__msvcrt_ulong enc, unsigned int *x, unsigned int *y)
+{
+    *x = *y = enc;
+    return TRUE;
+}
+#endif
 #endif
 
 #if _MSVCR_VER>=120
@@ -5887,15 +5895,10 @@ int CDECL fesetenv(const fenv_t *env)
         return 0;
     }
 
-#if _MSVCR_VER>=140
     if (!fenv_decode(env->_Fe_ctl, &x87_cw, &sse_cw))
         return 1;
     if (!fenv_decode(env->_Fe_stat, &x87_stat, &sse_stat))
         return 1;
-#else
-    x87_cw = sse_cw = env->_Fe_ctl;
-    x87_stat = sse_stat = env->_Fe_stat;
-#endif
 
     __asm__ __volatile__( "fnstenv %0" : "=m" (fenv) );
 




More information about the wine-cvs mailing list