mirror of
https://github.com/MariaDB/server.git
synced 2026-05-04 14:15:33 +02:00
Fix windows build: provide log2 function if the system doesn't have it.
This commit is contained in:
parent
4b71be9052
commit
7d9dc97682
2 changed files with 14 additions and 0 deletions
|
|
@ -852,6 +852,7 @@ AC_CHECK_HEADERS([xfs/xfs.h])
|
|||
#--------------------------------------------------------------------
|
||||
|
||||
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, gethostbyname_r))
|
||||
|
|
|
|||
|
|
@ -2567,6 +2567,19 @@ inline bool is_user_table(TABLE * table)
|
|||
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
|
||||
server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue