Commit 7d9dc976 authored by Sergey Petrunya's avatar Sergey Petrunya

Fix windows build: provide log2 function if the system doesn't have it.

parent 4b71be90
...@@ -852,6 +852,7 @@ AC_CHECK_HEADERS([xfs/xfs.h]) ...@@ -852,6 +852,7 @@ AC_CHECK_HEADERS([xfs/xfs.h])
#-------------------------------------------------------------------- #--------------------------------------------------------------------
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity)) AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
AC_CHECK_FUNCS(log2)
AC_CHECK_LIB(nsl_r, gethostbyname_r, [], AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
AC_CHECK_LIB(nsl, gethostbyname_r)) AC_CHECK_LIB(nsl, gethostbyname_r))
......
...@@ -2567,6 +2567,19 @@ inline bool is_user_table(TABLE * table) ...@@ -2567,6 +2567,19 @@ inline bool is_user_table(TABLE * table)
return strncmp(name, tmp_file_prefix, tmp_file_prefix_length); return strncmp(name, tmp_file_prefix, tmp_file_prefix_length);
} }
#ifndef HAVE_LOG2
/*
This will be slightly slower and perhaps a tiny bit less accurate than
doing it the IEEE754 way but log2() should be available on C99 systems.
*/
inline double log2(double x)
{
return (log(x) / M_LN2);
}
#endif
/* /*
Some functions that are different in the embedded library and the normal Some functions that are different in the embedded library and the normal
server server
......
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