Module: wine Branch: stable Commit: e9e33f5e9162acc9411c4bef3354be19b60ee1e9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e9e33f5e9162acc9411c4bef33...
Author: Alex Henrie alexhenrie24@gmail.com Date: Wed Jul 12 18:05:09 2017 +0200
msvcr120: Add acosh.
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 f1dad14807ae9650c66d83ec35fbc016b91ac471) 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 | 45 ++++++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 6 +-- include/config.h.in | 6 +++ 8 files changed, 67 insertions(+), 12 deletions(-)
diff --git a/configure b/configure index ceb6419..eed2c2e 100755 --- a/configure +++ b/configure @@ -17110,6 +17110,8 @@ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h fi
for ac_func in \ + acosh \ + acoshf \ asinh \ asinhf \ cbrt \ diff --git a/configure.ac b/configure.ac index 353f271..9e60a76 100644 --- a/configure.ac +++ b/configure.ac @@ -2534,6 +2534,8 @@ then fi
AC_CHECK_FUNCS(\ + acosh \ + acoshf \ asinh \ asinhf \ cbrt \ 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 d5ade42..50fc298 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 @@ -124,9 +124,9 @@ @ cdecl _yn(long double) ucrtbase._yn @ cdecl acos(double) ucrtbase.acos @ cdecl -arch=arm,x86_64 acosf(float) ucrtbase.acosf -@ stub acosh -@ stub acoshf -@ stub acoshl +@ cdecl acosh(double) ucrtbase.acosh +@ cdecl acoshf(float) ucrtbase.acoshf +@ cdecl acoshl(double) ucrtbase.acoshl @ cdecl asin(double) ucrtbase.asin @ cdecl -arch=arm,x86_64 asinf(float) ucrtbase.asinf @ cdecl asinh(double double) ucrtbase.asinh diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index f98c25b..9e4be38 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2011,9 +2011,9 @@ @ cdecl abs(long) MSVCRT_abs @ cdecl acos(double) MSVCRT_acos @ cdecl -arch=arm,x86_64 acosf(float) MSVCRT_acosf -@ stub acosh -@ stub acoshf -@ stub acoshl +@ cdecl acosh(double) MSVCR120_acosh +@ cdecl acoshf(float) MSVCR120_acoshf +@ cdecl acoshl(double) MSVCR120_acoshl @ cdecl asctime(ptr) MSVCRT_asctime @ cdecl asctime_s(ptr long ptr) MSVCRT_asctime_s @ cdecl asin(double) MSVCRT_asin diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 0a7d3e4..09a6dee 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1677,9 +1677,9 @@ @ cdecl abs(long) msvcr120.abs @ cdecl acos(double) msvcr120.acos @ cdecl -arch=arm,x86_64 acosf(float) msvcr120.acosf -@ stub acosh -@ stub acoshf -@ stub acoshl +@ cdecl acosh(double) msvcr120.acosh +@ cdecl acoshf(float) msvcr120.acoshf +@ cdecl acoshl(double) msvcr120.acoshl @ cdecl asctime(ptr) msvcr120.asctime @ cdecl asctime_s(ptr long ptr) msvcr120.asctime_s @ cdecl asin(double) msvcr120.asin diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 323ed2c..81911de 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2898,6 +2898,51 @@ LDOUBLE CDECL MSVCR120_asinhl(LDOUBLE x) }
/********************************************************************* + * acosh (MSVCR120.@) + */ +double CDECL MSVCR120_acosh(double x) +{ + if (x < 1) *MSVCRT__errno() = MSVCRT_EDOM; + +#ifdef HAVE_ACOSH + return acosh(x); +#else + if (x < 1) { + MSVCRT_fenv_t env; + + MSVCRT_fegetenv(&env); + env.status |= MSVCRT__SW_INVALID; + MSVCRT_fesetenv(&env); + return NAN; + } + if (!isfinite(x*x)) return log(2) + log(x); + return log(x + sqrt(x*x-1)); +#endif +} + +/********************************************************************* + * acoshf (MSVCR120.@) + */ +float CDECL MSVCR120_acoshf(float x) +{ +#ifdef HAVE_ACOSHF + if (x < 1) *MSVCRT__errno() = MSVCRT_EDOM; + + return acoshf(x); +#else + return MSVCR120_acosh(x); +#endif +} + +/********************************************************************* + * acoshl (MSVCR120.@) + */ +LDOUBLE CDECL MSVCR120_acoshl(LDOUBLE x) +{ + return MSVCR120_acosh(x); +} + +/********************************************************************* * _scalb (MSVCRT.@) * scalbn (MSVCR120.@) * scalbln (MSVCR120.@) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index c75d75e..c563808 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2153,9 +2153,9 @@ @ cdecl abs(long) MSVCRT_abs @ cdecl acos(double) MSVCRT_acos @ cdecl -arch=arm,x86_64 acosf(float) MSVCRT_acosf -@ stub acosh -@ stub acoshf -@ stub acoshl +@ cdecl acosh(double) MSVCR120_acosh +@ cdecl acoshf(float) MSVCR120_acoshf +@ cdecl acoshl(double) MSVCR120_acoshl @ cdecl asctime(ptr) MSVCRT_asctime @ cdecl asctime_s(ptr long ptr) MSVCRT_asctime_s @ cdecl asin(double) MSVCRT_asin diff --git a/include/config.h.in b/include/config.h.in index 5dcd90b..618731e 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -10,6 +10,12 @@ /* Define to the file extension for executables. */ #undef EXEEXT
+/* Define to 1 if you have the `acosh' function. */ +#undef HAVE_ACOSH + +/* Define to 1 if you have the `acoshf' function. */ +#undef HAVE_ACOSHF + /* Define to 1 if you have the <alias.h> header file. */ #undef HAVE_ALIAS_H