Alex Henrie : msvcr120: Set errno in log2.

Alexandre Julliard julliard at winehq.org
Tue Jul 18 13:58:55 CDT 2017


Module: wine
Branch: master
Commit: b1230c34845ed36b52dcc05244502c51ac2f0a3a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b1230c34845ed36b52dcc05244502c51ac2f0a3a

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Mon Jul 17 22:33:52 2017 -0600

msvcr120: Set errno in log2.

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

---

 dlls/msvcrt/math.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index b12ce8b..637f920 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -2488,6 +2488,8 @@ LDOUBLE CDECL MSVCR120_log1pl(LDOUBLE x)
  */
 double CDECL MSVCR120_log2(double x)
 {
+    if (x < 0) *MSVCRT__errno() = MSVCRT_EDOM;
+    else if (x == 0) *MSVCRT__errno() = MSVCRT_ERANGE;
 #ifdef HAVE_LOG2
     return log2(x);
 #else
@@ -2500,6 +2502,8 @@ double CDECL MSVCR120_log2(double x)
  */
 float CDECL MSVCR120_log2f(float x)
 {
+    if (x < 0) *MSVCRT__errno() = MSVCRT_EDOM;
+    else if (x == 0) *MSVCRT__errno() = MSVCRT_ERANGE;
 #ifdef HAVE_LOG2F
     return log2f(x);
 #else




More information about the wine-cvs mailing list