diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/base/hmatrix.cabal | 6 | ||||
-rw-r--r-- | packages/base/src/Internal/C/windows_random_r.c | 4 | ||||
-rw-r--r-- | packages/base/src/Internal/C/windows_random_r.h | 20 |
3 files changed, 13 insertions, 17 deletions
diff --git a/packages/base/hmatrix.cabal b/packages/base/hmatrix.cabal index 5e4f3ce..93ca3d7 100644 --- a/packages/base/hmatrix.cabal +++ b/packages/base/hmatrix.cabal | |||
@@ -25,7 +25,7 @@ build-type: Simple | |||
25 | extra-source-files: THANKS.md CHANGELOG | 25 | extra-source-files: THANKS.md CHANGELOG |
26 | 26 | ||
27 | extra-source-files: src/Internal/C/lapack-aux.h | 27 | extra-source-files: src/Internal/C/lapack-aux.h |
28 | src/C/windows_random_r.h | 28 | src/Internal/C/windows_random_r.h |
29 | 29 | ||
30 | flag openblas | 30 | flag openblas |
31 | description: Link with OpenBLAS (https://github.com/xianyi/OpenBLAS) optimized libraries. | 31 | description: Link with OpenBLAS (https://github.com/xianyi/OpenBLAS) optimized libraries. |
@@ -75,10 +75,10 @@ library | |||
75 | Internal.Util | 75 | Internal.Util |
76 | Internal.Modular | 76 | Internal.Modular |
77 | Internal.Static | 77 | Internal.Static |
78 | 78 | ||
79 | C-sources: src/Internal/C/lapack-aux.c | 79 | C-sources: src/Internal/C/lapack-aux.c |
80 | src/Internal/C/vector-aux.c | 80 | src/Internal/C/vector-aux.c |
81 | src/C/windows_random_r.c | 81 | src/Internal/C/windows_random_r.c |
82 | 82 | ||
83 | 83 | ||
84 | extensions: ForeignFunctionInterface, | 84 | extensions: ForeignFunctionInterface, |
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 | ||
391 | int my_errno; | 391 | int 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 | ||
12 | typedef int int32_t; | 10 | typedef int int32_t; |
13 | 11 | ||
14 | struct random_data | 12 | struct 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 | ||
23 | extern int windows_random_r_errno; | ||
25 | 24 | ||
26 | #define errno my_errno | 25 | static inline void __set_errno(int err) { windows_random_r_errno = err; }; |
27 | extern int my_errno; | ||
28 | |||
29 | static inline void __set_errno(int err) { my_errno = err; }; | ||
30 | 26 | ||
31 | int random_r (struct random_data *buf, int32_t *result); | 27 | int random_r (struct random_data *buf, int32_t *result); |
32 | 28 | ||