mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
Automerge
This commit is contained in:
commit
aa6c879944
2 changed files with 34 additions and 3 deletions
21
configure.in
21
configure.in
|
@ -2085,6 +2085,27 @@ esac
|
||||||
AC_MSG_CHECKING(for isinf in <math.h>)
|
AC_MSG_CHECKING(for isinf in <math.h>)
|
||||||
AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
|
AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_MSG_CHECKING(whether isinf() is safe to use in C code)
|
||||||
|
AC_TRY_RUN([
|
||||||
|
#include <math.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
double a= 10.0;
|
||||||
|
double b= 1e308;
|
||||||
|
|
||||||
|
return !isinf(a * b);
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[AC_MSG_RESULT(yes)],
|
||||||
|
[AC_MSG_RESULT(no)
|
||||||
|
AC_DEFINE([HAVE_BROKEN_ISINF], [1],
|
||||||
|
[Define to 1 if isinf() uses 80-bit register for intermediate values])
|
||||||
|
],
|
||||||
|
[
|
||||||
|
# Let's be optimistic when cross-compiling, since the only compiler known
|
||||||
|
# to be affected by this isinf() bug is GCC 4.3 on 32-bit x86.
|
||||||
|
AC_MSG_RESULT([[cross-compiling, assuming 'yes']])
|
||||||
|
])
|
||||||
AC_MSG_CHECKING(whether isinf() can be used in C++ code)
|
AC_MSG_CHECKING(whether isinf() can be used in C++ code)
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
|
|
|
@ -905,10 +905,20 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ISINF
|
#ifdef HAVE_ISINF
|
||||||
/* isinf() can be used in both C and C++ code */
|
/* Check if C compiler is affected by GCC bug #39228 */
|
||||||
#define my_isinf(X) isinf(X)
|
#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF)
|
||||||
|
/* Force store/reload of the argument to/from a 64-bit double */
|
||||||
|
static inline double my_isinf(double x)
|
||||||
|
{
|
||||||
|
volatile double t= x;
|
||||||
|
return isinf(t);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
#define my_isinf(X) (!isfinite(X) && !isnan(X))
|
/* System-provided isinf() is available and safe to use */
|
||||||
|
#define my_isinf(X) isinf(X)
|
||||||
|
#endif
|
||||||
|
#else /* !HAVE_ISINF */
|
||||||
|
#define my_isinf(X) (!finite(X) && !isnan(X))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define missing math constants. */
|
/* Define missing math constants. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue