summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal')
-rw-r--r--packages/base/src/Internal/C/windows_random_r.c4
-rw-r--r--packages/base/src/Internal/C/windows_random_r.h20
2 files changed, 10 insertions, 14 deletions
diff --git a/packages/base/src/Internal/C/windows_random_r.c b/packages/base/src/Internal/C/windows_random_r.c
index c16d96f..872cb2e 100644
--- a/packages/base/src/Internal/C/windows_random_r.c
+++ b/packages/base/src/Internal/C/windows_random_r.c
@@ -53,7 +53,7 @@
53 * Rewritten to be reentrant by Ulrich Drepper, 1995 53 * Rewritten to be reentrant by Ulrich Drepper, 1995
54 */ 54 */
55 55
56#include "myrandom.h" 56#include "windows_random_r.h"
57 57
58/* An improved random number generation package. In addition to the standard 58/* An improved random number generation package. In addition to the standard
59 rand()/srand() like interface, this package also has a special state info 59 rand()/srand() like interface, this package also has a special state info
@@ -388,5 +388,5 @@ int random_r (struct random_data *buf, int32_t *result)
388 return -1; 388 return -1;
389} 389}
390 390
391int my_errno; 391int windows_random_r;
392#endif \ No newline at end of file 392#endif \ No newline at end of file
diff --git a/packages/base/src/Internal/C/windows_random_r.h b/packages/base/src/Internal/C/windows_random_r.h
index c05caa7..4f4d32f 100644
--- a/packages/base/src/Internal/C/windows_random_r.h
+++ b/packages/base/src/Internal/C/windows_random_r.h
@@ -1,32 +1,28 @@
1#if defined(_WIN32) || defined(WIN32) 1#if defined(_WIN32) || defined(WIN32)
2 2
3#ifndef MYRANDOM_H 3#ifndef WINDOWS_RANDOM_R_H
4#define MYRANDOM_H 4#define WINDOWS_RANDOM_R_H
5 5
6#include <stddef.h> 6#include <stddef.h>
7 7
8#define NULL 0
9
10#define EINVAL 23 8#define EINVAL 23
11 9
12typedef int int32_t; 10typedef int int32_t;
13 11
14struct random_data 12struct random_data
15{ 13{
16 int32_t *fptr; /* Front pointer. */ 14 int *fptr; /* Front pointer. */
17 int32_t *rptr; /* Rear pointer. */ 15 int *rptr; /* Rear pointer. */
18 int32_t *state; /* Array of state values. */ 16 int *state; /* Array of state values. */
19 int rand_type; /* Type of random number generator. */ 17 int rand_type; /* Type of random number generator. */
20 int rand_deg; /* Degree of random number generator. */ 18 int rand_deg; /* Degree of random number generator. */
21 int rand_sep; /* Distance between front and rear. */ 19 int rand_sep; /* Distance between front and rear. */
22 int32_t *end_ptr; /* Pointer behind state table. */ 20 int *end_ptr; /* Pointer behind state table. */
23}; 21};
24 22
23extern int windows_random_r_errno;
25 24
26#define errno my_errno 25static inline void __set_errno(int err) { windows_random_r_errno = err; };
27extern int my_errno;
28
29static inline void __set_errno(int err) { my_errno = err; };
30 26
31int random_r (struct random_data *buf, int32_t *result); 27int random_r (struct random_data *buf, int32_t *result);
32 28