diff options
author | Alberto Ruiz <aruiz@um.es> | 2015-07-21 11:22:41 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2015-07-21 11:22:41 +0200 |
commit | d2decb1cec8ff4cb29cb3e9f8d787d3081fd42ee (patch) | |
tree | 50ab9e01bf7a4805b49687255113aba3a14162ab /packages/base/src/Internal/C/windows_random_r.h | |
parent | 792864d3ec95d198a751591256c302aed11d8392 (diff) | |
parent | 5440f119dc099279c5cf9e282dffcaa4e26f8541 (diff) |
Merge remote-tracking branch 'origin/master' into wip
Diffstat (limited to 'packages/base/src/Internal/C/windows_random_r.h')
-rw-r--r-- | packages/base/src/Internal/C/windows_random_r.h | 35 |
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 | |||
10 | typedef int int32_t; | ||
11 | |||
12 | struct 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 | |||
23 | extern int windows_random_r_errno; | ||
24 | |||
25 | static inline void __set_errno(int err) { windows_random_r_errno = err; }; | ||
26 | |||
27 | int random_r (struct random_data *buf, int32_t *result); | ||
28 | |||
29 | int 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 | ||