mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
2a1e0d1618
git-svn-id: file:///svn/toku/tokudb.1032b@8109 c7de825b-a66e-492c-adef-691d508d4ae1
26 lines
525 B
C
26 lines
525 B
C
//rand_s requires _CRT_RAND_S be defined before including stdlib
|
|
#define _CRT_RAND_S
|
|
|
|
#include <stdio.h>
|
|
#include <assert.h>
|
|
#include <stdint.h>
|
|
#include <toku_stdlib.h>
|
|
#include <windows.h>
|
|
|
|
long int
|
|
random(void) {
|
|
u_int32_t r;
|
|
errno_t r_error = rand_s(&r);
|
|
assert(r_error==0);
|
|
//Should return 0 to 2**31-1 instead of 2**32-1
|
|
r >>= 1;
|
|
return r;
|
|
}
|
|
|
|
//TODO: Implement srandom to modify the way rand_s works (IF POSSIBLE).. or
|
|
//reimplement random.
|
|
void
|
|
srandom(unsigned int seed) {
|
|
seed = seed;
|
|
}
|
|
|