Module: wine Branch: stable Commit: 202932a6f307cbba5ed77551321b8eb2204b465f URL: https://source.winehq.org/git/wine.git/?a=commit;h=202932a6f307cbba5ed775513... Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Fri Mar 2 10:02:46 2018 -0700 msvcrt: Compile but show an error if Bessel functions aren't available. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit acd2f1e59bd22197b63eb5ae4ac0d621a0b8cce0) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- configure | 8 +++++++- configure.ac | 8 +++++++- dlls/msvcrt/math.c | 36 +++++++++++++++++++++++++++++++++--- include/config.h.in | 18 ++++++++++++++++++ 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/configure b/configure index f62b9e3..be6e012 100755 --- a/configure +++ b/configure @@ -17654,6 +17654,9 @@ for ac_func in \ exp2f \ expm1 \ expm1f \ + j0 \ + j1 \ + jn \ lgamma \ lgammaf \ llrint \ @@ -17678,7 +17681,10 @@ for ac_func in \ round \ roundf \ trunc \ - truncf + truncf \ + y0 \ + y1 \ + yn do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` diff --git a/configure.ac b/configure.ac index 9aa3228..3b037f9 100644 --- a/configure.ac +++ b/configure.ac @@ -2660,6 +2660,9 @@ AC_CHECK_FUNCS(\ exp2f \ expm1 \ expm1f \ + j0 \ + j1 \ + jn \ lgamma \ lgammaf \ llrint \ @@ -2684,7 +2687,10 @@ AC_CHECK_FUNCS(\ round \ roundf \ trunc \ - truncf + truncf \ + y0 \ + y1 \ + yn ) LIBS="$ac_save_LIBS" diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 9b48011..a3af78a 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1412,7 +1412,12 @@ INT CDECL MSVCRT__isnan(double num) double CDECL MSVCRT__j0(double num) { /* FIXME: errno handling */ +#ifdef HAVE_J0 return j0(num); +#else + FIXME("not implemented\n"); + return 0; +#endif } /********************************************************************* @@ -1421,7 +1426,12 @@ double CDECL MSVCRT__j0(double num) double CDECL MSVCRT__j1(double num) { /* FIXME: errno handling */ +#ifdef HAVE_J1 return j1(num); +#else + FIXME("not implemented\n"); + return 0; +#endif } /********************************************************************* @@ -1430,7 +1440,12 @@ double CDECL MSVCRT__j1(double num) double CDECL MSVCRT__jn(int n, double num) { /* FIXME: errno handling */ +#ifdef HAVE_JN return jn(n, num); +#else + FIXME("not implemented\n"); + return 0; +#endif } /********************************************************************* @@ -1440,12 +1455,17 @@ double CDECL MSVCRT__y0(double num) { double retval; if (!isfinite(num)) *MSVCRT__errno() = MSVCRT_EDOM; +#ifdef HAVE_Y0 retval = y0(num); if (MSVCRT__fpclass(retval) == MSVCRT__FPCLASS_NINF) { *MSVCRT__errno() = MSVCRT_EDOM; - retval = sqrt(-1); + retval = NAN; } +#else + FIXME("not implemented\n"); + retval = 0; +#endif return retval; } @@ -1456,12 +1476,17 @@ double CDECL MSVCRT__y1(double num) { double retval; if (!isfinite(num)) *MSVCRT__errno() = MSVCRT_EDOM; +#ifdef HAVE_Y1 retval = y1(num); if (MSVCRT__fpclass(retval) == MSVCRT__FPCLASS_NINF) { *MSVCRT__errno() = MSVCRT_EDOM; - retval = sqrt(-1); + retval = NAN; } +#else + FIXME("not implemented\n"); + retval = 0; +#endif return retval; } @@ -1472,12 +1497,17 @@ double CDECL MSVCRT__yn(int order, double num) { double retval; if (!isfinite(num)) *MSVCRT__errno() = MSVCRT_EDOM; +#ifdef HAVE_YN retval = yn(order,num); if (MSVCRT__fpclass(retval) == MSVCRT__FPCLASS_NINF) { *MSVCRT__errno() = MSVCRT_EDOM; - retval = sqrt(-1); + retval = NAN; } +#else + FIXME("not implemented\n"); + retval = 0; +#endif return retval; } diff --git a/include/config.h.in b/include/config.h.in index 9224837..551080a 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -336,6 +336,15 @@ /* Define to 1 if you have the `isnanf' function. */ #undef HAVE_ISNANF +/* Define to 1 if you have the `j0' function. */ +#undef HAVE_J0 + +/* Define to 1 if you have the `j1' function. */ +#undef HAVE_J1 + +/* Define to 1 if you have the `jn' function. */ +#undef HAVE_JN + /* Define to 1 if you have the <jpeglib.h> header file. */ #undef HAVE_JPEGLIB_H @@ -1359,6 +1368,15 @@ /* Define if Xrandr has the XRRGetScreenResources function */ #undef HAVE_XRRGETSCREENRESOURCES +/* Define to 1 if you have the `y0' function. */ +#undef HAVE_Y0 + +/* Define to 1 if you have the `y1' function. */ +#undef HAVE_Y1 + +/* Define to 1 if you have the `yn' function. */ +#undef HAVE_YN + /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_ZLIB