Module: wine Branch: stable Commit: 8848e97e1d0760138485b51621b8a3f3eabc7f61 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8848e97e1d0760138485b51621...
Author: Alex Henrie alexhenrie24@gmail.com Date: Mon Jul 17 22:33:51 2017 -0600
msvcr120: Add log1p.
Signed-off-by: Alex Henrie alexhenrie24@gmail.com Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 31b835d0e0124d6f6e3e4f6fc9ad53de6182dee1) Signed-off-by: Michael Stefaniuc mstefani@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 44a7d42..833b989 100755 --- a/configure +++ b/configure @@ -17130,6 +17130,8 @@ for ac_func in \ llrintf \ llround \ llroundf \ + log1p \ + log1pf \ log2 \ log2f \ lrint \ diff --git a/configure.ac b/configure.ac index be48d24..e5376bf 100644 --- a/configure.ac +++ b/configure.ac @@ -2554,6 +2554,8 @@ AC_CHECK_FUNCS(\ llrintf \ llround \ llroundf \ + log1p \ + log1pf \ log2 \ log2f \ lrint \ 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 f23782c..9a10bb8 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 @@ -270,9 +270,9 @@ @ cdecl log(double) ucrtbase.log @ cdecl log10(double) ucrtbase.log10 @ cdecl -arch=arm,x86_64 log10f(float) ucrtbase.log10f -@ stub log1p -@ stub log1pf -@ stub log1pl +@ cdecl log1p(double) ucrtbase.log1p +@ cdecl log1pf(float) ucrtbase.log1pf +@ cdecl log1pl(double) ucrtbase.log1pl @ cdecl log2(double) ucrtbase.log2 @ cdecl log2f(float) ucrtbase.log2f @ cdecl log2l(double) ucrtbase.log2l diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 26f7ecd..7b2c5eb 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2259,9 +2259,9 @@ @ cdecl -arch=arm,x86_64 logf(float) MSVCRT_logf @ cdecl log10(double) MSVCRT_log10 @ cdecl -arch=arm,x86_64 log10f(float) MSVCRT_log10f -@ stub log1p -@ stub log1pf -@ stub log1pl +@ cdecl log1p(double) MSVCR120_log1p +@ cdecl log1pf(float) MSVCR120_log1pf +@ cdecl log1pl(double) MSVCR120_log1pl @ cdecl log2(double) MSVCR120_log2 @ cdecl log2f(float) MSVCR120_log2f @ cdecl log2l(double) MSVCR120_log2l diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 3e9d5fe..83b0862 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1922,9 +1922,9 @@ @ cdecl -arch=arm,x86_64 logf(float) msvcr120.logf @ cdecl log10(double) msvcr120.log10 @ cdecl -arch=arm,x86_64 log10f(float) msvcr120.log10f -@ stub log1p -@ stub log1pf -@ stub log1pl +@ cdecl log1p(double) msvcr120.log1p +@ cdecl log1pf(float) msvcr120.log1pf +@ cdecl log1pl(double) msvcr120.log1pl @ cdecl log2(double) msvcr120.log2 @ cdecl log2f(float) msvcr120.log2f @ cdecl log2l(double) msvcr120.log2l diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 562cdda..775fbac 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2452,6 +2452,42 @@ LDOUBLE CDECL MSVCR120_expm1l(LDOUBLE x) }
/********************************************************************* + * log1p (MSVCR120.@) + */ +double CDECL MSVCR120_log1p(double x) +{ + if (x < -1) *MSVCRT__errno() = MSVCRT_EDOM; + else if (x == -1) *MSVCRT__errno() = MSVCRT_ERANGE; +#ifdef HAVE_LOG1P + return log1p(x); +#else + return log(1 + x); +#endif +} + +/********************************************************************* + * log1pf (MSVCR120.@) + */ +float CDECL MSVCR120_log1pf(float x) +{ + if (x < -1) *MSVCRT__errno() = MSVCRT_EDOM; + else if (x == -1) *MSVCRT__errno() = MSVCRT_ERANGE; +#ifdef HAVE_LOG1PF + return log1pf(x); +#else + return log(1 + x); +#endif +} + +/********************************************************************* + * log1pl (MSVCR120.@) + */ +LDOUBLE CDECL MSVCR120_log1pl(LDOUBLE x) +{ + return MSVCR120_log1p(x); +} + +/********************************************************************* * log2 (MSVCR120.@) */ double CDECL MSVCR120_log2(double x) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index d3f496b..85d2ed3 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2392,9 +2392,9 @@ @ cdecl log(double) MSVCRT_log @ cdecl log10(double) MSVCRT_log10 @ cdecl -arch=arm,x86_64 log10f(float) MSVCRT_log10f -@ stub log1p -@ stub log1pf -@ stub log1pl +@ cdecl log1p(double) MSVCR120_log1p +@ cdecl log1pf(float) MSVCR120_log1pf +@ cdecl log1pl(double) MSVCR120_log1pl @ cdecl log2(double) MSVCR120_log2 @ cdecl log2f(float) MSVCR120_log2f @ cdecl log2l(double) MSVCR120_log2l diff --git a/include/config.h.in b/include/config.h.in index 5b2457e..99906bd 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -507,6 +507,12 @@ /* Define to 1 if you have the `llroundf' function. */ #undef HAVE_LLROUNDF
+/* Define to 1 if you have the `log1p' function. */ +#undef HAVE_LOG1P + +/* Define to 1 if you have the `log1pf' function. */ +#undef HAVE_LOG1PF + /* Define to 1 if you have the `log2' function. */ #undef HAVE_LOG2