Alex Henrie : msvcr120: Add expm1.

Alexandre Julliard julliard at winehq.org
Fri Oct 20 07:19:58 CDT 2017


Module: wine
Branch: stable
Commit: 94bf7cc632e8c7c57843fce541e40bcebd9888d5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=94bf7cc632e8c7c57843fce541e40bcebd9888d5

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Thu Jul 13 23:14:20 2017 -0600

msvcr120: Add expm1.

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>
(cherry picked from commit 79715cce88ef372eb56374f14c4771b748029105)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 configure                                          |  2 ++
 configure.ac                                       |  2 ++
 .../api-ms-win-crt-math-l1-1-0.spec                |  6 ++--
 dlls/msvcr120/msvcr120.spec                        |  6 ++--
 dlls/msvcr120_app/msvcr120_app.spec                |  6 ++--
 dlls/msvcrt/math.c                                 | 36 ++++++++++++++++++++++
 dlls/ucrtbase/ucrtbase.spec                        |  6 ++--
 include/config.h.in                                |  6 ++++
 8 files changed, 58 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index c736fe8..44a7d42 100755
--- a/configure
+++ b/configure
@@ -17122,6 +17122,8 @@ for ac_func in \
 	erff \
 	exp2 \
 	exp2f \
+	expm1 \
+	expm1f \
 	lgamma \
 	lgammaf \
 	llrint \
diff --git a/configure.ac b/configure.ac
index dd4c0e3..be48d24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2546,6 +2546,8 @@ AC_CHECK_FUNCS(\
 	erff \
 	exp2 \
 	exp2f \
+	expm1 \
+	expm1f \
 	lgamma \
 	lgammaf \
 	llrint \
diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec
index fb78f07..f23782c 100644
--- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec
+++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec
@@ -231,9 +231,9 @@
 @ cdecl exp2f(float) ucrtbase.exp2f
 @ cdecl exp2l(double) ucrtbase.exp2l
 @ cdecl -arch=arm,x86_64 expf(float) ucrtbase.expf
-@ stub expm1
-@ stub expm1f
-@ stub expm1l
+@ cdecl expm1(double) ucrtbase.expm1
+@ cdecl expm1f(float) ucrtbase.expm1f
+@ cdecl expm1l(double) ucrtbase.expm1l
 @ cdecl fabs(double) ucrtbase.fabs
 @ cdecl -arch=arm fabsf(float) ucrtbase.fabsf
 @ stub fdim
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 5177122..26f7ecd 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -2134,9 +2134,9 @@
 @ cdecl exp2f(float) MSVCR120_exp2f
 @ cdecl exp2l(double) MSVCR120_exp2l
 @ cdecl -arch=arm,x86_64 expf(float) MSVCRT_expf
-@ stub expm1
-@ stub expm1f
-@ stub expm1l
+@ cdecl expm1(double) MSVCR120_expm1
+@ cdecl expm1f(float) MSVCR120_expm1f
+@ cdecl expm1l(double) MSVCR120_expm1l
 @ cdecl fabs(double) MSVCRT_fabs
 @ cdecl -arch=arm,x86_64 fabsf(float) MSVCRT_fabsf
 @ cdecl fclose(ptr) MSVCRT_fclose
diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec
index 0c4adb3..3e9d5fe 100644
--- a/dlls/msvcr120_app/msvcr120_app.spec
+++ b/dlls/msvcr120_app/msvcr120_app.spec
@@ -1800,9 +1800,9 @@
 @ cdecl exp2f(float) msvcr120.exp2f
 @ cdecl exp2l(double) msvcr120.exp2l
 @ cdecl -arch=arm,x86_64 expf(float) msvcr120.expf
-@ stub expm1
-@ stub expm1f
-@ stub expm1l
+@ cdecl expm1(double) msvcr120.expm1
+@ cdecl expm1f(float) msvcr120.expm1f
+@ cdecl expm1l(double) msvcr120.expm1l
 @ cdecl fabs(double) msvcr120.fabs
 @ cdecl -arch=arm,x86_64 fabsf(float) msvcr120.fabsf
 @ cdecl fclose(ptr) msvcr120.fclose
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 867ef22..562cdda 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -2416,6 +2416,42 @@ LDOUBLE CDECL MSVCR120_exp2l(LDOUBLE x)
 }
 
 /*********************************************************************
+ *      expm1 (MSVCR120.@)
+ */
+double CDECL MSVCR120_expm1(double x)
+{
+#ifdef HAVE_EXPM1
+    double ret = expm1(x);
+#else
+    double ret = exp(x) - 1;
+#endif
+    if (!isfinite(ret)) *MSVCRT__errno() = MSVCRT_ERANGE;
+    return ret;
+}
+
+/*********************************************************************
+ *      expm1f (MSVCR120.@)
+ */
+float CDECL MSVCR120_expm1f(float x)
+{
+#ifdef HAVE_EXPM1F
+    double ret = expm1f(x);
+#else
+    double ret = exp(x) - 1;
+#endif
+    if (!isfinite(ret)) *MSVCRT__errno() = MSVCRT_ERANGE;
+    return ret;
+}
+
+/*********************************************************************
+ *      expm1l (MSVCR120.@)
+ */
+LDOUBLE CDECL MSVCR120_expm1l(LDOUBLE x)
+{
+    return MSVCR120_expm1(x);
+}
+
+/*********************************************************************
  *      log2 (MSVCR120.@)
  */
 double CDECL MSVCR120_log2(double x)
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index 763e037..d3f496b 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -2277,9 +2277,9 @@
 @ cdecl exp2f(float) MSVCR120_exp2f
 @ cdecl exp2l(double) MSVCR120_exp2l
 @ cdecl -arch=arm,x86_64 expf(float) MSVCRT_expf
-@ stub expm1
-@ stub expm1f
-@ stub expm1l
+@ cdecl expm1(double) MSVCR120_expm1
+@ cdecl expm1f(float) MSVCR120_expm1f
+@ cdecl expm1l(double) MSVCR120_expm1l
 @ cdecl fabs(double) MSVCRT_fabs
 @ cdecl -arch=arm fabsf(float) MSVCRT_fabsf
 @ cdecl fclose(ptr) MSVCRT_fclose
diff --git a/include/config.h.in b/include/config.h.in
index 56295f3..5b2457e 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -147,6 +147,12 @@
 /* Define to 1 if you have the `exp2f' function. */
 #undef HAVE_EXP2F
 
+/* Define to 1 if you have the `expm1' function. */
+#undef HAVE_EXPM1
+
+/* Define to 1 if you have the `expm1f' function. */
+#undef HAVE_EXPM1F
+
 /* Define to 1 if you have the `fallocate' function. */
 #undef HAVE_FALLOCATE
 




More information about the wine-cvs mailing list