summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/C/windows_random_r.h
diff options
context:
space:
mode:
authorNightRa <ilan3580@gmail.com>2015-07-18 22:52:08 +0300
committerNightRa <ilan3580@gmail.com>2015-07-18 22:52:08 +0300
commita544e9810ef34b8eb39f7856f500f25fce1cd207 (patch)
tree79f901a38a817c4a85de12f63e156bab2810e69c /packages/base/src/Internal/C/windows_random_r.h
parenta273fdb74b04db6d57d5c9b15e676d83357e71fd (diff)
Fix windows support
Diffstat (limited to 'packages/base/src/Internal/C/windows_random_r.h')
-rw-r--r--packages/base/src/Internal/C/windows_random_r.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/packages/base/src/Internal/C/windows_random_r.h b/packages/base/src/Internal/C/windows_random_r.h
new file mode 100644
index 0000000..c05caa7
--- /dev/null
+++ b/packages/base/src/Internal/C/windows_random_r.h
@@ -0,0 +1,39 @@
1#if defined(_WIN32) || defined(WIN32)
2
3#ifndef MYRANDOM_H
4#define MYRANDOM_H
5
6#include <stddef.h>
7
8#define NULL 0
9
10#define EINVAL 23
11
12typedef int int32_t;
13
14struct random_data
15{
16 int32_t *fptr; /* Front pointer. */
17 int32_t *rptr; /* Rear pointer. */
18 int32_t *state; /* Array of state values. */
19 int rand_type; /* Type of random number generator. */
20 int rand_deg; /* Degree of random number generator. */
21 int rand_sep; /* Distance between front and rear. */
22 int32_t *end_ptr; /* Pointer behind state table. */
23};
24
25
26#define errno my_errno
27extern int my_errno;
28
29static inline void __set_errno(int err) { my_errno = err; };
30
31int random_r (struct random_data *buf, int32_t *result);
32
33int initstate_r (unsigned int seed,
34 char *arg_state,
35 /*unsigned long*/ size_t n,
36 struct random_data *buf);
37
38#endif
39#endif \ No newline at end of file