diff --git a/configure b/configure index f6053f19b55801aba5a052a6c0c949958dfee777..199d4d8b11d5d40680fb2057e67a2eb624da16e5 100755 --- a/configure +++ b/configure @@ -17406,6 +17406,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 d557df82dac2640074f7b65d869fb0af9d5d4025..3974dd5818e8036fb09ec6c1838ad16504937e0e 100644 --- a/configure.ac +++ b/configure.ac @@ -2594,6 +2594,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 5d2499b782f62aaae6a370a30bb13d9b01fb958e..5c644326ced68ec440b779dde477a74aa6fba48b 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) ucrtbase.asinh diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 989a3cb572d7a380bd3a30cba36c68a638458ee9..7899622f69ce502c3b817c523a08eddb3bc79cb2 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 345bb51a106406c0a2d19f74c63e82de7be90fd0..9a5da20ca8be6d5f0f9acf71cdffe7d043cc49c0 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 387aab3b524b30287f34faffb8820fc691cec609..17edf47dfaa6b1ab373f9edd47d0ab192ecc033f 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2898,6 +2898,51 @@ LDOUBLE CDECL MSVCR120_asinhl(LDOUBLE x) return MSVCR120_asinh(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.@) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 3e7c79564cce0260797115e77bab6f17d66a34b9..1eae07222d7c924448a58295b9396a8c0a308b1f 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 c28755911a094073a7f362516b94ba8a02b53a2a..4a9acca547195de255f2461c2e01a7d722723594 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