summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/C/windows_random_r.h
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/C/windows_random_r.h')
-rw-r--r--packages/base/src/Internal/C/windows_random_r.h35
1 files changed, 35 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..4f4d32f
--- /dev/null
+++ b/packages/base/src/Internal/C/windows_random_r.h
@@ -0,0 +1,35 @@
1#if defined(_WIN32) || defined(WIN32)
2
3#ifndef WINDOWS_RANDOM_R_H
4#define WINDOWS_RANDOM_R_H
5
6#include <stddef.h>
7
8#define EINVAL 23
9
10typedef int int32_t;
11
12struct random_data
13{
14 int *fptr; /* Front pointer. */
15 int *rptr; /* Rear pointer. */
16 int *state; /* Array of state values. */
17 int rand_type; /* Type of random number generator. */
18 int rand_deg; /* Degree of random number generator. */
19 int rand_sep; /* Distance between front and rear. */
20 int *end_ptr; /* Pointer behind state table. */
21};
22
23extern int windows_random_r_errno;
24
25static inline void __set_errno(int err) { windows_random_r_errno = err; };
26
27int random_r (struct random_data *buf, int32_t *result);
28
29int initstate_r (unsigned int seed,
30 char *arg_state,
31 /*unsigned long*/ size_t n,
32 struct random_data *buf);
33
34#endif
35#endif \ No newline at end of file