mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Fix Windows compiler error 'log2f': identifier not found
This commit is contained in:
parent
f13cf62147
commit
251239af67
2 changed files with 16 additions and 2 deletions
|
@ -39,6 +39,13 @@ Completed by Sunny Bains and Marko Makela
|
|||
#include "row0import.h"
|
||||
#include "handler0alter.h"
|
||||
#include "ha_prototypes.h"
|
||||
#include "math.h" /* log() */
|
||||
|
||||
float my_log2f(float n)
|
||||
{
|
||||
/* log(n) / log(2) is log2. */
|
||||
return (float)(log((double)n) / log((double)2));
|
||||
}
|
||||
|
||||
/* Ignore posix_fadvise() on those platforms where it does not exist */
|
||||
#if defined __WIN__
|
||||
|
@ -2222,7 +2229,7 @@ row_merge_sort(
|
|||
|
||||
/* Find the number N which 2^N is greater or equal than num_runs */
|
||||
/* N is merge sort running count */
|
||||
total_merge_sort_count = ceil(log2f(num_runs));
|
||||
total_merge_sort_count = ceil(my_log2f(num_runs));
|
||||
if(total_merge_sort_count <= 0) {
|
||||
total_merge_sort_count=1;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,13 @@ Completed by Sunny Bains and Marko Makela
|
|||
#include "row0import.h"
|
||||
#include "handler0alter.h"
|
||||
#include "ha_prototypes.h"
|
||||
#include "math.h" /* log2() */
|
||||
|
||||
float my_log2f(float n)
|
||||
{
|
||||
/* log(n) / log(2) is log2. */
|
||||
return (float)(log((double)n) / log((double)2));
|
||||
}
|
||||
|
||||
/* Ignore posix_fadvise() on those platforms where it does not exist */
|
||||
#if defined __WIN__
|
||||
|
@ -2228,7 +2235,7 @@ row_merge_sort(
|
|||
|
||||
/* Find the number N which 2^N is greater or equal than num_runs */
|
||||
/* N is merge sort running count */
|
||||
total_merge_sort_count = ceil(log2f(num_runs));
|
||||
total_merge_sort_count = ceil(my_log2f(num_runs));
|
||||
if(total_merge_sort_count <= 0) {
|
||||
total_merge_sort_count=1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue