msvcrt: Add errno EDOM setting for atan(NAN)/exp(NAN)/tanh(NAN)

Zheng Chen chanchengcc at gmail.com
Tue Mar 24 03:01:44 CDT 2015


Thanks to Piotr.

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

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 12a0be9..efa9733 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -363,6 +363,7 @@ double CDECL MSVCRT_asin( double x )
  */
 double CDECL MSVCRT_atan( double x )
 {
+  if (isnan(x)) *MSVCRT__errno() = MSVCRT_EDOM;
   return atan(x);
 }

@@ -398,6 +399,7 @@ double CDECL MSVCRT_cosh( double x )
  */
 double CDECL MSVCRT_exp( double x )
 {
+  if (isnan(x)) *MSVCRT__errno() = MSVCRT_EDOM;
   return exp(x);
 }

@@ -482,6 +484,7 @@ double CDECL MSVCRT_tan( double x )
  */
 double CDECL MSVCRT_tanh( double x )
 {
+  if (isnan(x)) *MSVCRT__errno() = MSVCRT_EDOM;
   return tanh(x);
 }

-- 
2.3.3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150324/f08f17b3/attachment.html>


More information about the wine-patches mailing list