forked from organicmaps/organicmaps
[mingw] Fixed build errors (stdlib.h doesn't have random() function defined)
This commit is contained in:
parent
47bbc46b9f
commit
5a615584b9
2 changed files with 18 additions and 15 deletions
|
@ -116,7 +116,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
/* On some machines, the exact arithmetic routines might be defeated by the */
|
||||
/* use of internal extended precision floating-point registers. Sometimes */
|
||||
|
@ -500,9 +500,9 @@ double doublerand()
|
|||
long a, b, c;
|
||||
long i;
|
||||
|
||||
a = random();
|
||||
b = random();
|
||||
c = random();
|
||||
a = rand();
|
||||
b = rand();
|
||||
c = rand();
|
||||
result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8);
|
||||
for (i = 512, expo = 2; i <= 131072; i *= 2, expo = expo * expo) {
|
||||
if (c & i) {
|
||||
|
@ -526,9 +526,9 @@ double narrowdoublerand()
|
|||
long a, b, c;
|
||||
long i;
|
||||
|
||||
a = random();
|
||||
b = random();
|
||||
c = random();
|
||||
a = rand();
|
||||
b = rand();
|
||||
c = rand();
|
||||
result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8);
|
||||
for (i = 512, expo = 2; i <= 2048; i *= 2, expo = expo * expo) {
|
||||
if (c & i) {
|
||||
|
@ -549,8 +549,8 @@ double uniformdoublerand()
|
|||
double result;
|
||||
long a, b;
|
||||
|
||||
a = random();
|
||||
b = random();
|
||||
a = rand();
|
||||
b = rand();
|
||||
result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8);
|
||||
return result;
|
||||
}
|
||||
|
@ -569,8 +569,8 @@ float floatrand()
|
|||
long a, c;
|
||||
long i;
|
||||
|
||||
a = random();
|
||||
c = random();
|
||||
a = rand();
|
||||
c = rand();
|
||||
result = (float) ((a - 1073741824) >> 6);
|
||||
for (i = 512, expo = 2; i <= 16384; i *= 2, expo = expo * expo) {
|
||||
if (c & i) {
|
||||
|
@ -594,8 +594,8 @@ float narrowfloatrand()
|
|||
long a, c;
|
||||
long i;
|
||||
|
||||
a = random();
|
||||
c = random();
|
||||
a = rand();
|
||||
c = rand();
|
||||
result = (float) ((a - 1073741824) >> 6);
|
||||
for (i = 512, expo = 2; i <= 2048; i *= 2, expo = expo * expo) {
|
||||
if (c & i) {
|
||||
|
@ -616,7 +616,7 @@ float uniformfloatrand()
|
|||
float result;
|
||||
long a;
|
||||
|
||||
a = random();
|
||||
a = rand();
|
||||
result = (float) ((a - 1073741824) >> 6);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
#include "robust_orientation.hpp"
|
||||
|
||||
#include "../3party/robust/predicates.c"
|
||||
extern "C"
|
||||
{
|
||||
#include "../3party/robust/predicates.c"
|
||||
}
|
||||
|
||||
#include "../base/start_mem_debug.hpp"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue