diff options
-rw-r--r-- | cmake/os/WindowsCache.cmake | 1 | ||||
-rw-r--r-- | config.h.cmake | 1 | ||||
-rw-r--r-- | configure.cmake | 1 | ||||
-rw-r--r-- | include/my_global.h | 35 |
4 files changed, 0 insertions, 38 deletions
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 5ad3be6e1bc..0d40fc344f6 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -139,7 +139,6 @@ SET(HAVE_READLINK CACHE INTERNAL "") SET(HAVE_READ_REAL_TIME CACHE INTERNAL "") SET(HAVE_REALPATH CACHE INTERNAL "") SET(HAVE_RENAME 1 CACHE INTERNAL "") -#SET(HAVE_RINT CACHE INTERNAL "") SET(HAVE_RWLOCK_INIT CACHE INTERNAL "") SET(HAVE_SCHED_H CACHE INTERNAL "") SET(HAVE_SCHED_YIELD CACHE INTERNAL "") diff --git a/config.h.cmake b/config.h.cmake index d413ec08313..fa0547d1ef2 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -210,7 +210,6 @@ #cmakedefine HAVE_READLINK 1 #cmakedefine HAVE_REALPATH 1 #cmakedefine HAVE_RENAME 1 -#cmakedefine HAVE_RINT 1 #cmakedefine HAVE_RWLOCK_INIT 1 #cmakedefine HAVE_SCHED_YIELD 1 #cmakedefine HAVE_SELECT 1 diff --git a/configure.cmake b/configure.cmake index 920af1de3dd..2b268a1c003 100644 --- a/configure.cmake +++ b/configure.cmake @@ -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(log2 math.h HAVE_LOG2) -CHECK_SYMBOL_EXISTS(rint math.h HAVE_RINT) # # Test for endianness diff --git a/include/my_global.h b/include/my_global.h index 65e10373d3b..05c6d02f390 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1179,41 +1179,6 @@ typedef struct { const char *dli_fname, dli_fbase; } Dl_info; #endif #endif /* !defined(__func__) */ -#ifndef HAVE_RINT -/** - All integers up to this number can be represented exactly as double precision - values (DBL_MANT_DIG == 53 for IEEE 754 hardware). -*/ -#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1) - -/** - rint(3) implementation for platforms that do not have it. - Always rounds to the nearest integer with ties being rounded to the nearest - even integer to mimic glibc's rint() behavior in the "round-to-nearest" - FPU mode. Hardware-specific optimizations are possible (frndint on x86). - Unlike this implementation, hardware will also honor the FPU rounding mode. -*/ - -static inline double rint(double x) -{ - double f, i; - f = modf(x, &i); - /* - All doubles with absolute values > MAX_EXACT_INTEGER are even anyway, - no need to check it. - */ - if (x > 0.0) - i += (double) ((f > 0.5) || (f == 0.5 && - i <= (double) MAX_EXACT_INTEGER && - (longlong) i % 2)); - else - i -= (double) ((f < -0.5) || (f == -0.5 && - i >= (double) -MAX_EXACT_INTEGER && - (longlong) i % 2)); - return i; -} -#endif /* HAVE_RINT */ - /* MYSQL_PLUGIN_IMPORT macro is used to export mysqld data (i.e variables) for usage in storage engine loadable plugins. |