Commit 7ffd7fe9 authored by Sergey Vojtovich's avatar Sergey Vojtovich

Cleanup isnan() portability checks

parent bc469a0b
...@@ -261,7 +261,6 @@ CHECK_SYMBOL_REPLACEMENT(S_IROTH _S_IREAD sys/stat.h) ...@@ -261,7 +261,6 @@ CHECK_SYMBOL_REPLACEMENT(S_IROTH _S_IREAD sys/stat.h)
CHECK_SYMBOL_REPLACEMENT(S_IFIFO _S_IFIFO sys/stat.h) CHECK_SYMBOL_REPLACEMENT(S_IFIFO _S_IFIFO sys/stat.h)
CHECK_SYMBOL_REPLACEMENT(SIGQUIT SIGTERM signal.h) CHECK_SYMBOL_REPLACEMENT(SIGQUIT SIGTERM signal.h)
CHECK_SYMBOL_REPLACEMENT(SIGPIPE SIGINT signal.h) CHECK_SYMBOL_REPLACEMENT(SIGPIPE SIGINT signal.h)
CHECK_SYMBOL_REPLACEMENT(isnan _isnan "math.h;float.h")
CHECK_FUNCTION_REPLACEMENT(popen _popen) CHECK_FUNCTION_REPLACEMENT(popen _popen)
CHECK_FUNCTION_REPLACEMENT(pclose _pclose) CHECK_FUNCTION_REPLACEMENT(pclose _pclose)
CHECK_FUNCTION_REPLACEMENT(access _access) CHECK_FUNCTION_REPLACEMENT(access _access)
......
...@@ -161,7 +161,6 @@ ...@@ -161,7 +161,6 @@
#cmakedefine gmtime_r @gmtime_r@ #cmakedefine gmtime_r @gmtime_r@
#cmakedefine HAVE_IN_ADDR_T 1 #cmakedefine HAVE_IN_ADDR_T 1
#cmakedefine HAVE_INITGROUPS 1 #cmakedefine HAVE_INITGROUPS 1
#cmakedefine HAVE_ISNAN 1
#cmakedefine HAVE_LARGE_PAGE_OPTION 1 #cmakedefine HAVE_LARGE_PAGE_OPTION 1
#cmakedefine HAVE_LDIV 1 #cmakedefine HAVE_LDIV 1
#cmakedefine HAVE_LRAND48 1 #cmakedefine HAVE_LRAND48 1
...@@ -419,7 +418,6 @@ ...@@ -419,7 +418,6 @@
#cmakedefine mode_t @mode_t@ #cmakedefine mode_t @mode_t@
#cmakedefine SIGQUIT @SIGQUIT@ #cmakedefine SIGQUIT @SIGQUIT@
#cmakedefine SIGPIPE @SIGPIPE@ #cmakedefine SIGPIPE @SIGPIPE@
#cmakedefine isnan @isnan@
#cmakedefine popen @popen@ #cmakedefine popen @popen@
#cmakedefine pclose @pclose@ #cmakedefine pclose @pclose@
#cmakedefine ssize_t @ssize_t@ #cmakedefine ssize_t @ssize_t@
......
...@@ -478,7 +478,6 @@ CHECK_SYMBOL_EXISTS(FIONREAD "sys/filio.h" FIONREAD_IN_SYS_FILIO) ...@@ -478,7 +478,6 @@ CHECK_SYMBOL_EXISTS(FIONREAD "sys/filio.h" FIONREAD_IN_SYS_FILIO)
CHECK_SYMBOL_EXISTS(gettimeofday "sys/time.h" HAVE_GETTIMEOFDAY) CHECK_SYMBOL_EXISTS(gettimeofday "sys/time.h" HAVE_GETTIMEOFDAY)
CHECK_SYMBOL_EXISTS(log2 math.h HAVE_LOG2) CHECK_SYMBOL_EXISTS(log2 math.h HAVE_LOG2)
CHECK_SYMBOL_EXISTS(isnan math.h HAVE_ISNAN)
CHECK_SYMBOL_EXISTS(rint math.h HAVE_RINT) CHECK_SYMBOL_EXISTS(rint math.h HAVE_RINT)
# #
......
...@@ -828,16 +828,8 @@ inline unsigned long long my_double2ulonglong(double d) ...@@ -828,16 +828,8 @@ inline unsigned long long my_double2ulonglong(double d)
#define SIZE_T_MAX (~((size_t) 0)) #define SIZE_T_MAX (~((size_t) 0))
#endif #endif
#ifndef HAVE_ISNAN
#define isnan(x) ((x) != (x))
#endif
#define my_isnan(x) isnan(x)
#ifdef __cplusplus #ifdef __cplusplus
#include <cmath> #include <cmath>
#ifndef isnan
#define isnan(X) std::isnan(X)
#endif
#endif #endif
/* Define missing math constants. */ /* Define missing math constants. */
......
...@@ -4683,7 +4683,7 @@ int truncate_double(double *nr, uint field_length, uint dec, ...@@ -4683,7 +4683,7 @@ int truncate_double(double *nr, uint field_length, uint dec,
int error= 0; int error= 0;
double res= *nr; double res= *nr;
if (isnan(res)) if (std::isnan(res))
{ {
*nr= 0; *nr= 0;
return -1; return -1;
......
...@@ -754,7 +754,6 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key, ...@@ -754,7 +754,6 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key,
uchar *pos= (uchar*) rec + seg->start; uchar *pos= (uchar*) rec + seg->start;
DBUG_ASSERT(seg->type != HA_KEYTYPE_BIT); DBUG_ASSERT(seg->type != HA_KEYTYPE_BIT);
#ifdef HAVE_ISNAN
if (seg->type == HA_KEYTYPE_FLOAT) if (seg->type == HA_KEYTYPE_FLOAT)
{ {
float nr; float nr;
...@@ -778,7 +777,6 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key, ...@@ -778,7 +777,6 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key,
continue; continue;
} }
} }
#endif
pos+= length; pos+= length;
while (length--) while (length--)
{ {
......
...@@ -279,7 +279,6 @@ MARIA_KEY *_ma_make_key(MARIA_HA *info, MARIA_KEY *int_key, uint keynr, ...@@ -279,7 +279,6 @@ MARIA_KEY *_ma_make_key(MARIA_HA *info, MARIA_KEY *int_key, uint keynr,
} }
else if (keyseg->flag & HA_SWAP_KEY) else if (keyseg->flag & HA_SWAP_KEY)
{ /* Numerical column */ { /* Numerical column */
#ifdef HAVE_ISNAN
if (type == HA_KEYTYPE_FLOAT) if (type == HA_KEYTYPE_FLOAT)
{ {
float nr; float nr;
...@@ -303,7 +302,6 @@ MARIA_KEY *_ma_make_key(MARIA_HA *info, MARIA_KEY *int_key, uint keynr, ...@@ -303,7 +302,6 @@ MARIA_KEY *_ma_make_key(MARIA_HA *info, MARIA_KEY *int_key, uint keynr,
continue; continue;
} }
} }
#endif
pos+=length; pos+=length;
while (length--) while (length--)
{ {
......
...@@ -77,7 +77,6 @@ MARIA_KEY *_ma_sp_make_key(MARIA_HA *info, MARIA_KEY *ret_key, uint keynr, ...@@ -77,7 +77,6 @@ MARIA_KEY *_ma_sp_make_key(MARIA_HA *info, MARIA_KEY *ret_key, uint keynr,
DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE); DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE);
val= mbr[start / sizeof (double)]; val= mbr[start / sizeof (double)];
#ifdef HAVE_ISNAN
if (isnan(val)) if (isnan(val))
{ {
bzero(key, length); bzero(key, length);
...@@ -85,7 +84,6 @@ MARIA_KEY *_ma_sp_make_key(MARIA_HA *info, MARIA_KEY *ret_key, uint keynr, ...@@ -85,7 +84,6 @@ MARIA_KEY *_ma_sp_make_key(MARIA_HA *info, MARIA_KEY *ret_key, uint keynr,
len+= length; len+= length;
continue; continue;
} }
#endif
if (keyseg->flag & HA_SWAP_KEY) if (keyseg->flag & HA_SWAP_KEY)
{ {
......
...@@ -150,7 +150,6 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, ...@@ -150,7 +150,6 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
} }
else if (keyseg->flag & HA_SWAP_KEY) else if (keyseg->flag & HA_SWAP_KEY)
{ /* Numerical column */ { /* Numerical column */
#ifdef HAVE_ISNAN
if (type == HA_KEYTYPE_FLOAT) if (type == HA_KEYTYPE_FLOAT)
{ {
float nr; float nr;
...@@ -174,7 +173,6 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, ...@@ -174,7 +173,6 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
continue; continue;
} }
} }
#endif
pos+=length; pos+=length;
while (length--) while (length--)
{ {
......
...@@ -66,7 +66,6 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, ...@@ -66,7 +66,6 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE); DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE);
val= mbr[start / sizeof (double)]; val= mbr[start / sizeof (double)];
#ifdef HAVE_ISNAN
if (isnan(val)) if (isnan(val))
{ {
bzero(key, length); bzero(key, length);
...@@ -74,7 +73,6 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, ...@@ -74,7 +73,6 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
len+= length; len+= length;
continue; continue;
} }
#endif
if (keyseg->flag & HA_SWAP_KEY) if (keyseg->flag & HA_SWAP_KEY)
{ {
......
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