Commit cdcabc6f authored by Sergey Vojtovich's avatar Sergey Vojtovich Committed by Vlad Lesin

Use std::isfinite in C++ code

This is addition to parent revision fixing build failures.

(cherry picked from commit 54999f4e)
parent fe7d354b
......@@ -815,17 +815,6 @@ inline unsigned long long my_double2ulonglong(double d)
#include <cmath>
#endif
#ifndef isfinite
#ifdef HAVE_FINITE
#define isfinite(x) finite(x)
#else
#define finite(x) (1.0 / fabs(x) > 0.0)
#endif /* HAVE_FINITE */
#elif (__cplusplus >= 201103L)
#include <cmath>
static inline bool isfinite(double x) { return std::isfinite(x); }
#endif /* isfinite */
/* Define missing math constants. */
#ifndef M_PI
#define M_PI 3.14159265358979323846
......
......@@ -2904,7 +2904,7 @@ int Field_decimal::store(double nr)
return 1;
}
if (!isfinite(nr)) // Handle infinity as special case
if (!std::isfinite(nr)) // Handle infinity as special case
{
overflow(nr < 0.0);
return 1;
......
......@@ -241,7 +241,7 @@ class Item_func :public Item_func_or_sum
*/
inline double check_float_overflow(double value)
{
return isfinite(value) ? value : raise_float_overflow();
return std::isfinite(value) ? value : raise_float_overflow();
}
/**
Throw an error if the input BIGINT value represented by the
......
......@@ -2655,7 +2655,7 @@ String *Item_func_format::val_str_ascii(String *str)
return 0; /* purecov: inspected */
nr= my_double_round(nr, (longlong) dec, FALSE, FALSE);
str->set_real(nr, dec, &my_charset_numeric);
if (!isfinite(nr))
if (!std::isfinite(nr))
return str;
str_length=str->length();
}
......
......@@ -367,7 +367,7 @@ mbr_join_square(
/* Check if finite (not infinity or NaN),
so we don't get NaN in calculations */
if (!isfinite(square)) {
if (!std::isfinite(square)) {
return DBL_MAX;
}
......
......@@ -1969,7 +1969,7 @@ rtr_estimate_n_rows_in_range(
mtr_commit(&mtr);
mem_heap_free(heap);
if (!isfinite(area)) {
if (!std::isfinite(area)) {
return(HA_POS_ERROR);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment