msvcrt: Implement the tgamma functions.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Martin Storsjo 2019-08-01 22:52:26 +03:00 committed by Alexandre Julliard
parent 83a95b8fcf
commit e38b46e7f7
8 changed files with 60 additions and 12 deletions

2
configure vendored
View File

@ -19289,6 +19289,8 @@ for ac_func in \
rintf \
round \
roundf \
tgamma \
tgammaf \
trunc \
truncf \
y0 \

View File

@ -2676,6 +2676,8 @@ AC_CHECK_FUNCS(\
rintf \
round \
roundf \
tgamma \
tgammaf \
trunc \
truncf \
y0 \

View File

@ -333,9 +333,9 @@
@ cdecl -arch=arm,x86_64,arm64 tanf(float) ucrtbase.tanf
@ cdecl tanh(double) ucrtbase.tanh
@ cdecl -arch=arm,x86_64,arm64 tanhf(float) ucrtbase.tanhf
@ stub tgamma
@ stub tgammaf
@ stub tgammal
@ cdecl tgamma(double) ucrtbase.tgamma
@ cdecl tgammaf(float) ucrtbase.tgammaf
@ cdecl tgammal(double) ucrtbase.tgammal
@ cdecl trunc(double) ucrtbase.trunc
@ cdecl truncf(float) ucrtbase.truncf
@ cdecl truncl(double) ucrtbase.truncl

View File

@ -2405,9 +2405,9 @@
@ cdecl -arch=arm,x86_64,arm64 tanf(float) MSVCRT_tanf
@ cdecl tanh(double) MSVCRT_tanh
@ cdecl -arch=arm,x86_64,arm64 tanhf(float) MSVCRT_tanhf
@ stub tgamma
@ stub tgammaf
@ stub tgammal
@ cdecl tgamma(double) MSVCR120_tgamma
@ cdecl tgammaf(float) MSVCR120_tgammaf
@ cdecl tgammal(double) MSVCR120_tgamma
@ cdecl tmpfile() MSVCRT_tmpfile
@ cdecl tmpfile_s(ptr) MSVCRT_tmpfile_s
@ cdecl tmpnam(ptr) MSVCRT_tmpnam

View File

@ -2067,9 +2067,9 @@
@ cdecl -arch=arm,x86_64,arm64 tanf(float) msvcr120.tanf
@ cdecl tanh(double) msvcr120.tanh
@ cdecl -arch=arm,x86_64,arm64 tanhf(float) msvcr120.tanhf
@ stub tgamma
@ stub tgammaf
@ stub tgammal
@ cdecl tgamma(double) msvcr120.tgamma
@ cdecl tgammaf(float) msvcr120.tgammaf
@ cdecl tgammal(double) msvcr120.tgammal
@ cdecl tmpfile() msvcr120.tmpfile
@ cdecl tmpfile_s(ptr) msvcr120.tmpfile_s
@ cdecl tmpnam(ptr) msvcr120.tmpnam

View File

@ -3404,6 +3404,44 @@ LDOUBLE CDECL MSVCR120_lgammal(LDOUBLE x)
return MSVCR120_lgamma(x);
}
/*********************************************************************
* tgamma (MSVCR120.@)
*/
double CDECL MSVCR120_tgamma(double x)
{
#ifdef HAVE_TGAMMA
if(x==0.0) *MSVCRT__errno() = MSVCRT_ERANGE;
if(x<0.0f) {
double integral;
if (modf(x, &integral) == 0)
*MSVCRT__errno() = MSVCRT_EDOM;
}
return tgamma(x);
#else
FIXME( "not implemented\n" );
return 0.0;
#endif
}
/*********************************************************************
* tgammaf (MSVCR120.@)
*/
float CDECL MSVCR120_tgammaf(float x)
{
#ifdef HAVE_TGAMMAF
if(x==0.0f) *MSVCRT__errno() = MSVCRT_ERANGE;
if(x<0.0f) {
float integral;
if (modff(x, &integral) == 0)
*MSVCRT__errno() = MSVCRT_EDOM;
}
return tgammaf(x);
#else
FIXME( "not implemented\n" );
return 0.0f;
#endif
}
/*********************************************************************
* nan (MSVCR120.@)
*/

View File

@ -2534,9 +2534,9 @@
@ cdecl tanh(double) MSVCRT_tanh
@ cdecl -arch=arm,x86_64,arm64 tanhf(float) MSVCRT_tanhf
@ cdecl terminate() MSVCRT_terminate
@ stub tgamma
@ stub tgammaf
@ stub tgammal
@ cdecl tgamma(double) MSVCR120_tgamma
@ cdecl tgammaf(float) MSVCR120_tgammaf
@ cdecl tgammal(double) MSVCR120_tgamma
@ cdecl tmpfile() MSVCRT_tmpfile
@ cdecl tmpfile_s(ptr) MSVCRT_tmpfile_s
@ cdecl tmpnam(ptr) MSVCRT_tmpnam

View File

@ -1166,6 +1166,12 @@
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define to 1 if you have the `tgamma' function. */
#undef HAVE_TGAMMA
/* Define to 1 if you have the `tgammaf' function. */
#undef HAVE_TGAMMAF
/* Define to 1 if you have the `thr_kill2' function. */
#undef HAVE_THR_KILL2